473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Unhandled Exception in visio

Hey guys, Im gettin an exception when i run this code. This code is taken from a VB code which is basically to create an add-in in visio using c#

Expand|Select|Wrap|Line Numbers
  1. private void ThisAddIn_Startup(object sender, System.EventArgs e)
  2.         {
  3.             Microsoft.Office.Core.CommandBars commandBars;
  4.             Microsoft.Office.Core.CommandBar commandBar;
  5.  
  6.             commandBars =(Microsoft.Office.Core.CommandBars)Application.CommandBars;
  7.             commandBar = commandBars.Add("Demo Toolbar",Office.MsoBarPosition.msoBarTop,"",true);
  8.             //set the context menu when the toolbar is visible.
  9.             commandBar.Context = Visio.VisUIObjSets.visUIObjSetDrawing + "*";
  10.  
  11.             //add a button wth a smiley face icon
  12.  
  13.             Microsoft.Office.Core.CommandBarButton DemoButton = (Microsoft.Office.Core.CommandBarButton)commandBar.Controls.Add(Microsoft.Office.Core.MsoControlType.msoControlButton,2950,"","","");
  14.             DemoButton.Tag = "Demo Button";
  15.             DemoButton.FaceId = 2950;
  16.             DemoButton.TooltipText= "Run Demo";
  17.  
  18.  
  19.  
  20.         }
Mar 12 '07 #1
1 1525
kenobewan
4,871 Expert 4TB
Please post the exception. Thanks.
Mar 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
5
by: Samuel R. Neff | last post by:
When you have an unhandled exception in vb.net how do you view the exception information in the debugger? In C# the debugger creates a local variable that points to the exception and you can...
2
by: John | last post by:
Hi there, I'm fairly new to VB.Net (and VB generally) so please bear with me if these are stupid questions! I'm trying run a procedure on multiple Visio files from a form created in VS 2003. ...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.