AnsweredAssumed Answered

ICommandBars exception - ArcMap crash

Question asked by Alberto on Jan 18, 2012
Latest reply on Jan 18, 2012 by Alberto
Testing my VB.NET 2010 app in ArcMap an exception occurs when ICommandBars is instantiated.

  
 ' zoom to selected      Dim mxApp As ESRI.ArcGIS.Framework.IApplication     Dim numUID As UID = New ESRI.ArcGIS.esriSystem.UID     numUID.Value = "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"     Dim commandBars As ICommandBars = mxApp.Document.CommandBars   '>>> error here!!!!!!!!     Dim cmdItem As ICommandItem = CommandBars.Find(numUID, False, False)     If Not (cmdItem Is Nothing) Then         cmdItem.Execute()     End If


Message: Exception first-chance type 'System.NullReferenceException' in LUCAS.dll.

Please can anybody help me?
Thanks in advance.
AL

P.S. ArcGIS 10 SP1 on Windows 7, VS2010.

Outcomes