Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VSTO 2.0 vs Excel VBA Ben Excel Programming 1 November 3rd 05 02:17 PM
Excel in VSTO Milo Excel Programming 0 June 17th 05 02:57 AM
Get VSTO code to run on every launch of Excel Dave Excel Programming 1 December 8th 04 08:56 PM
VBA Crashes Excel on Compile or Stop Debug Frank & Pam Hayes[_2_] Excel Programming 0 June 24th 04 09:52 PM
VSTO Excel Addin JK Excel Programming 0 April 14th 04 09:26 PM


All times are GMT +1. The time now is 05:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"