VSTO & .NET & Excel

August 21, 2007

FolderBrowserDialog and Managed COM Add-ins

Filed under: .NET & Excel, COM Add-ins, VSTO & Excel — Dennis M Wallentin @ 5:51 pm

I’m working with the new version of .NET Connection Tool and discovered an odd thing. In a Windows Forms I have added a FolderBrowserDialog enabling users to select a new folder to move the Access database to.

The code in use is the following:

folder.png

As you can see the code disables the button to create new folders with. When using it in Windows Vista & Excel 2007 the folder browser’s form is showed correctly as the following image shows:

2k7.png 

With Windows XP and Excel 2002 and Excel 2003 it also works properly. However, when using it in Windows 2000 & Excel 2000 the option to create a new folder is now available:

2k.png

Since I’m not been able to resolve it myself I wonder if anyone know how to solve it so that the button New Folder is also not available in Excel 2000?

Kind regards,
Dennis
 

Advertisements

2 Comments »

  1. Hej Dennis,

    Nice little article, well presented as always. (And I’ve never tried using the FolderBrowserDialog, so it was nice to see some code. :))

    I would imagine that there would be a subclassing hack, or you could call the windows API equivalent. (Or maybe even try calling VB6’s version.)

    But I would not bother with it… Sometimes it is too much effort to get the legacy compatiblity 100% and I would think that this is good enough. Personally, I can’t think of a scenario where one would need to suppress the ability to create a new file for the destination anyway.

    But the short answer is: no, I don’t know how. LOL

    :-),
    Mike

    Comment by Mike Rosenblum — August 23, 2007 @ 3:55 pm

  2. Hej Mike,

    Yes, it’s more of an annoying thing then a real issue. However, I was rather surprised when I saw it for the first time 🙂

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — August 23, 2007 @ 5:50 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: