vsto

Use CLR classes from COM addin in Excel VBA?

╄→гoц情女王★ 提交于 2020-07-22 11:06:46
问题 I have an Excel VSTO COM addin, which I can successfully load an refer to in Excel VBA. I can exchange basic types (like strings), but can I also use complex classes from my addin in VBA? Let's say I have this class in C#: public class TestClass { public string GetTextFunc() => "check"; public string TextProp => "doublecheck"; public int RollDice() => 4; // chosen by fair dice roll } ...and my addin provides an object of this class to Excel: [ComVisible(true)] public interface IUtilities {

Programatically bringing up Excel's “Trust Center Settings” dialog

梦想的初衷 提交于 2020-07-15 07:39:00
问题 I need users to click the "Trust access to the VBA project object model" so that an app I'm building can help them import code to the VBE. I could display a messagebox or provide documentation telling them how to change setting (and warning about repercussions if they do). But that setting is still buried 5 clicks down in the Excel UI...in fact even I have trouble remembering where to find it. So what I'd like to do is programmatically open that window for them. I could probably use the

Programatically bringing up Excel's “Trust Center Settings” dialog

断了今生、忘了曾经 提交于 2020-07-15 07:38:18
问题 I need users to click the "Trust access to the VBA project object model" so that an app I'm building can help them import code to the VBE. I could display a messagebox or provide documentation telling them how to change setting (and warning about repercussions if they do). But that setting is still buried 5 clicks down in the Excel UI...in fact even I have trouble remembering where to find it. So what I'd like to do is programmatically open that window for them. I could probably use the

Replacing part of Outlook client's window with a custom form

和自甴很熟 提交于 2020-07-09 07:13:17
问题 I am developing a VSTO application for Outlook client. I am trying have my form open in the part of the Outlook client window which is highlighted in red in the following image: I think I can't use the form regions because they replace the view for a single item. So basically what I want to do is opening my custom form (windows or web) in the red area when I click my tool's button on the toolbar. Any ideas how this can be done? 回答1: There are three main ways for displaying your own form there