New version requiring Microsoft.VisualStudio.Interop.dll

229 views
Skip to first unread message

bpie...@gmail.com

unread,
Dec 8, 2021, 8:51:17 AM12/8/21
to Excel-DNA
A minor thing, but pointing it out in case there is anything going on beyond simply some refactoring Microsoft has done. I have a method that uses the IPictureDisp type, and previously I simply had a Nuget ref to stdole.dll  and all was fine. After updating, I am required to include both stdole.dll and Microsoft.VisualStudio.dll in my project ...and pack it into the add-in... in order to use that type. Possibly there's a way to avoid that, but I haven't figured it out yet. It just seems strange to bundle the VisualStudio interop dll with the add-in, but not a big deal if that is required.

Govert van Drimmelen

unread,
Dec 8, 2021, 9:58:23 AM12/8/21
to exce...@googlegroups.com

--------------------------------------------------

Excel-DNA is now registered on GitHub Sponsors.

Your monthly contribution helps the project thrive.

--------------------------------------------------

 

Hi Brian,

 

In most settings you don’t need to use the COM IPictureDisp type from .NET code.

You can just use an object of type System.Drawing.Image instead.

In particular, this is true for images you use for Excel ribbon extensions.

 

-Govert

--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/9ef24375-4725-4ff2-ad54-8febfe7d5d71n%40googlegroups.com.

bpie...@gmail.com

unread,
Dec 8, 2021, 10:33:19 AM12/8/21
to Excel-DNA
Hi Govert,

I allow users to select from a variety of images in addition to providing their own. Among the options are Mso images (Application.CommandBars.GetImageMso(...)) which returns an IPictureDisp, and I need to know that type in order to convert it to a type suitable for use as a menu icon.

Not a problem at all for me to just include the Visual Studio interop dll, just raising it in case it revealed something unintended.

Brian

bpie...@gmail.com

unread,
Dec 8, 2021, 10:58:12 AM12/8/21
to Excel-DNA
I realized I can avoid the need to include that Visual Studio interop assembly by making my references to IPictureDisp a dynamic type, so this has become a total non-issue for me.

bpie...@gmail.com

unread,
Dec 9, 2021, 12:13:38 PM12/9/21
to Excel-DNA
Scratch that -- I do need that dll, but again not a problem. -Brian
Reply all
Reply to author
Forward
0 new messages