vsto

Can we use UDF in excel custom validation

╄→гoц情女王★ 提交于 2019-12-13 02:16:25
问题 I have added the UDF in my excel template(C#) using excel addin classlibrary,but i can not use that function in custom validation when i use the UDF in custom validation of excel(data->validation->dropdownlist(custom))i get an error as: You can not use references to other worksheeta or workbooks for data validation criteria. Is there any solution to this problem? Can we use UDF in custom validation of excel? 回答1: I had forgotten about the UDF-in-data validation restriction. I think that

SignalR, Outlook add-in and multithread exception

痴心易碎 提交于 2019-12-13 01:25:30
问题 In Outlook I have this code... _connection = New HubConnection(Me._url) _connection.Credentials = CredentialCache.DefaultCredentials _hub = _connection.CreateHubProxy(Me._hubName) _hub.On(Of String)("NewMessage", Function(message) Dim f As New TestForm f.Show() Return "" End Function) _connection.Start() But showing my form "TestForm" crashes since its in the main thread and SignalR is on another thread. Any idea how I can make it work? 回答1: Your best attempt would be to use a dedicated

Reloading an Excel Addin Programmatically

守給你的承諾、 提交于 2019-12-13 01:15:37
问题 I have an excel plug in that has a number of features. I have a button on the ribbon titled "configuration settings" that allows the user to select whether or not to allow some options (whether to include a right click menu, or to display some buttons on my ribbon). The only way that I know to define a right click menu or to design the ribbon is in the start up of the excel addin. I have a config file that gets checked on load, but should the user change the configuration using my ribbon

Unable to re-register VSTO Add-in after choosing [Remove] from COM Add-ins window

南笙酒味 提交于 2019-12-12 23:22:25
问题 I am developing a VSTO add-in for Ms Word. Run -> Start (F5) in VS 2017 worked fine. Today I ran my first tests by publishing the add-in (ClickOnce, generating a .vsto file) and setting it up on the same computer I use for developing/debugging. In order to set it up in Word I just double-clicked the .vsto file and get a green-tick confirmation message indicating the customization was successfully installed. I could use the release version no problem. Then I wanted to go back to developing

Reordering Excel Table Columns with Filters Intact

≡放荡痞女 提交于 2019-12-12 22:51:16
问题 I am running into an issue with Excel 2007 via VSTO 3.0. In my project, I need to shuffle columns around occasionally. Normally, this works fine but I have recently found that an issue arises when the data is filtered and the fitlered data is non-contiguous. For example, using this data set: Ohio Eastern Kentucky Eastern Illinois Central California Pacific Florida Eastern If the filter on column two excludes either Pacific or Central, the following code produces an error. ListObject table =

VS 2017 Document-level add-in build fails with com visible components

一个人想着一个人 提交于 2019-12-12 20:54:39
问题 I have VS 2013 installed and I added 2017 RC. I made a document-level modified excel solution with some customisation in C# and this works fine. Then I added some VBA code in the spreadsheet and added a com-visible class following this link (which fails if I try to open it in chrome but works ok in edge). In ThisWorkbook.cs I have the following code... using System.Runtime.InteropServices; namespace WeekendingTabsNET40 { [ComVisible(true)] public interface IWeekending { string

How can I determine new & previous cell value on SheetChange event in Excel?

纵然是瞬间 提交于 2019-12-12 20:50:35
问题 I have some special cells in my Excel workbooks which are managed by my Excel Add-in. I want to prevent users from changing content of those cells, but I also want to know, what value users wanted to enter to those cells. On the SheetChange event I can check what users entered to my special cells, but how do I determine the PREVIOUS value in those cells and REVERT user changes? It is not a solution for me. If I lock cell in Excel, it becomes read-only - user can not even try to enter anything

Out of Memory failure automating VSTO Powerpoint API

允我心安 提交于 2019-12-12 20:43:08
问题 I am using the VSTO Powerpoint API to automate the creation of Powerpoint files. What I have found is that using the most basic call to create a Powerpoint file from a web application on a Windows 7 system causes an out of memory error (other VSTO calls that manipulate an open file also fail): PowerPoint.Presentation presentation = _ppPresentations.Add(Office.MsoTriState.msoTrue); string outputDirectory= getOutputDirectory(); presentation.SaveAs(outputDirectory+ "\\CreateSlideTestOutput.pptx"

Office integration (Word) - intercepting save

自闭症网瘾萝莉.ら 提交于 2019-12-12 20:02:16
问题 I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC. This is the easy part ;) Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a

Adding pre-defined Office Ribbon button to custom ribbon in Visual Ribbon Designer

為{幸葍}努か 提交于 2019-12-12 19:43:31
问题 I know how to add existing Office Ribbon items or groups to my custom ribbon using XML ( using idMso tags ) but how do I do this using the Visual Studio Ribbon ( Visual Designer ) technique? Would really rather not have to build the entire thing using XML. 回答1: In Ribbon Designer , you can access the ControlId which points to the idMSO used in Ribbon UI XML . More specifically, ControlId.OfficeId represents the idMSO property that contains the specific Office control identifier. tools.Ribbon