Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO Excel Crashes in Debug
Folks,
I created a new VSTO Excel project, put a MessageBox in the WB_Open event, and hit the 'Debug'. Excel tried to load, then went south. When I open the workbook outside of .NET, the workbook opens and the MessageBox appears. What might be causing Excel to crash in VSTO? -- Bob Sullentrup |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO Excel Crashes in Debug
All of my experience is with VSTO 2003.
Open Excel, go to help/About MS Excel. In the About window, there is a "Disabled Items" button in the lower right corner. Pressing it will get you a list of problem office docs. You can re-enable them from here. This may fix your problem. You may also want to check the Task Manager for more than 1 instance of excel.exe. This may be part of the problem too. In addition, VSTO handles errors in a strange way. If your code throws an exception, execution stops and returns to the document, with no indication of an error. When in doubt, put a try/catch block around all code that interfaces with document objects. Use the Debug.Writeline() method to give you an idea what the problem is. VSTO is a quantum leap over VBA (even in C#), but it takes some getting used to. "Bob Sullentrup" wrote: Folks, I created a new VSTO Excel project, put a MessageBox in the WB_Open event, and hit the 'Debug'. Excel tried to load, then went south. When I open the workbook outside of .NET, the workbook opens and the MessageBox appears. What might be causing Excel to crash in VSTO? -- Bob Sullentrup |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VSTO Excel Crashes in Debug
Here's the solution for VSTO unable to Debug:
Symptom: In Visual Studio, Debug (F5) launches Excel, then vanishes. Solution: Create an XML file called Excel.Exe.Config: <configuration <startup <supportedRuntime version="v1.1.4322"/ <supportedRuntime version="v1.0.3705"/ </startup </configuration The versions must match what you find in C:\Windows\Microsoft.Net\Framework Place Excel.Exe.Config in the folder that contains Excel.Exe, probably C:\program files\Microsoft Office\Office11 -- Bob Sullentrup "Otto" wrote: All of my experience is with VSTO 2003. Open Excel, go to help/About MS Excel. In the About window, there is a "Disabled Items" button in the lower right corner. Pressing it will get you a list of problem office docs. You can re-enable them from here. This may fix your problem. You may also want to check the Task Manager for more than 1 instance of excel.exe. This may be part of the problem too. In addition, VSTO handles errors in a strange way. If your code throws an exception, execution stops and returns to the document, with no indication of an error. When in doubt, put a try/catch block around all code that interfaces with document objects. Use the Debug.Writeline() method to give you an idea what the problem is. VSTO is a quantum leap over VBA (even in C#), but it takes some getting used to. "Bob Sullentrup" wrote: Folks, I created a new VSTO Excel project, put a MessageBox in the WB_Open event, and hit the 'Debug'. Excel tried to load, then went south. When I open the workbook outside of .NET, the workbook opens and the MessageBox appears. What might be causing Excel to crash in VSTO? -- Bob Sullentrup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VSTO 2.0 vs Excel VBA | Excel Programming | |||
Excel in VSTO | Excel Programming | |||
Get VSTO code to run on every launch of Excel | Excel Programming | |||
VBA Crashes Excel on Compile or Stop Debug | Excel Programming | |||
VSTO Excel Addin | Excel Programming |