VSTO & .NET & Excel

February 24, 2009

Load Ribbon UI XML files

Filed under: .NET & Excel, VSTO & Excel — Dennis M Wallentin @ 12:25 am

For some years I have used one approach to load Ribbon XML files in VB.NET’s solutions. Recently I discovered that it exist a better approach. Perhaps not better but definitely a better looking “one line” solution. I find it interesting that we can always solve code related issues in one of three ways; bad, OK and excellent. In the most cases I solve them OK.

Anyway, the key to the better solution is to add the Ribbon XML file to the project’s Resource list. Next, in the GetCustomUI function the file is loaded in one go as we also can see in the picture below (line 28).

myresourceribbonxml

I guess I need to explore My.Resources more!

Kind regards,
Dennis

Advertisements

1 Comment »

  1. how can i import ribbon xml into designer.cs ?

    Comment by martin — May 25, 2010 @ 2:42 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

Blog at WordPress.com.

%d bloggers like this: