vsto

Exception when calling RTD server from Excel

限于喜欢 提交于 2019-12-08 04:34:31
I wrote a VSTO Excel addin using Visual Studio 2010 and after having managed to work around most of the obstacles Microsoft throws into the path of the righteous developer, I finally have to admit defeat. My project contains a Ribbon with some controls, a custom task pane that allows users to search a database via a RESTful interface and a RTD server that lets them put this data in their worksheets. So far, so ... well, painful, I guess: After a lot of struggle with Interop, ComVisibility and AppDomains (what a great idea!), my current status is as follows. In the worksheets, I call a wrapper

parser to convert .net dictionary or list to VBA's equivalent dictionary or collection

安稳与你 提交于 2019-12-08 04:32:31
问题 i have to pass the .net dictionary or list type of object to VBA. but when i am passing the .net dictionary at VBA side i am not able to see the elements of dictionary on .net side. My code in C# Dictionary<string,object> dict = new Dictionary<string,object>(); dict.Add("First", "1"); dict.Add("Second", "2"); dict.Add("third", "3"); dict.Add("Forth", "4"); i am calling the VBA macro from C# as Application.Run("MyVBAMacro", dict); in VBA side My Macro is public Sub MyVBAMacro(var as variant)

Office Ribbon: How to access a control when the ribbon was created using XML

强颜欢笑 提交于 2019-12-08 04:05:38
问题 I used a ribbon XML file to create a custom tab which contains a togglebutton. The button is meant to toggle the visibility of a custom task pane and works great. The problem is that when the user close the custom task pane, the toggle button is now out of sync. How do I programmaticly access the togglebutton so I can change its IsChecked value? 回答1: You need to handle the VisibleChanged event. Add the following method to your ThisAddIn class - when the user closes the task pane by clicking

OpenSharedItem for opening .MSG files showing Error in Outlook C#

六月ゝ 毕业季﹏ 提交于 2019-12-08 02:52:57
问题 I am using the following code to open the signed/unsigned Outlook messages and I display the content in WebBrowser control. Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application(); var item = app.Session.OpenSharedItem(msgfile) as Microsoft.Office.Interop.Outlook.MailItem; string message = item.HTMLBody; app.Session.Logoff(); It is working fine for the first time the file is opening, but after closing the Outlook file trying to reopen the file it

Write to cell in excel using c#

て烟熏妆下的殇ゞ 提交于 2019-12-08 01:22:42
问题 I created a visual studio excel workbook project which contains ThisWorkbook class and I then included a functions class so that I can create my own excel function. I am trying to write a value to a cell using c# through the use of the function. I can write to the excel cell through the function class but only by creating a new application/workbook. So everytime I use this excel function, it will open new instance of excel. Is there a way I can write to a cell in the current excel workbook

Visual Studio 2008 Outlook 2007 AddIn with WPF Window

时光毁灭记忆、已成空白 提交于 2019-12-08 01:01:13
问题 I've not been able to find a whole lot on this anywhere. Let me start by saying I don't want to use the old Windows Form. I want to add a new WPF Window to my outlook 2007 addin project in visual studio 2008. The WPF Window template however does not show up. I was following this tutorial: http://msdn.microsoft.com/en-us/library/bb410039.aspx, which even had a picture of how you could add a new wpf window to your outlook 2007 addin. The only problem is that it is for visual studio 2005. Surely

getting Call was rejected by callee exception in VSTO ( Word Application )

别来无恙 提交于 2019-12-07 21:52:23
问题 It's been 3 days that I'm fooling around VSTO (Word application) I want to create a report in a word document. I already set some bookmarks in the template document. so my application just opens the template document and search for the each bookmark and replace the bookmark with a table or text in the word document. I open the word like : application = new Application { DisplayAlerts = false, WindowState = WdWindowState.wdWindowStateMaximize, Visible = false, CheckLanguage = false,

Expose VSTO functionality to VBA w/o local admin

半腔热情 提交于 2019-12-07 19:47:50
问题 What would be the best way to expose certain functionality in a Dotnet VSTO Excel add-in to VBA, without requiring the user to be a local administrator (i.e. no COM registration, no HttpListener)? Would it be possible to use Microsoft Message Queues from VBA? 回答1: If I may interpret your question as broadly as "How do I expose functionality in a .Net assembly to Excel without COM registration" then an excellent solution is to use Excel's XLL interface. Basically one deploys an xll shim and an

VSTO Alternatives [closed]

天涯浪子 提交于 2019-12-07 16:25:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . What alternatives exist for VSTO? What does managedxll do that VSTO does not - When would you use one vs the other Google does not bring much up on this subject This is more of an interview question - What are the pros and cons and both is the crux of the question here 回答1: VSTO presumes you are using Visual

How to disable Excel built-in RibbonButton?

99封情书 提交于 2019-12-07 15:24:18
问题 Is it possible to set an excel 2010 built in RibbonButton to enabled=false from an excel VSTO Add-In? I tried the following: CommandBarControls controlls=Globals.ThisAddIn.Application.CommandBars.FindControls(MsoControlType.msoControlButton, 7374, null, false); /// 7374 is the office control id of the control I want to access foreach (CommandBarControl control in controlls) { control.Enabled = false; } But this seems to work only for the right click context menu. And not for the ribbon