Bertil Emmertz

I have a problem when creating an Excel Workbook application using VSTO. I can add one control, e.g. a Button but if I try to add another a dialog pops up saying "Visual Studio has encountered an unexpected error." If I create a Word application everything works ok, i.e. I can add more than one control in the document. I have added no code to the project.

I am running VS2005 Team System Developer Edition with Service Pack 1 installed. I have also upgraded VSTO to SE. I am running Office 2003 with the latest service pack. I have tried to uninstall and reinstall everything without any success, the problem remains.

Does anyone have any idea what can cause this problem

Any hint or proposal of how I can try to nail this problem is appreciated, I have run out of ideas myselft.

BEzt regards



Re: Visual Studio Tools for Office Can only add one Windows Control in design mode in Excel using VSTO

Cindy Meister

Hi Bertil

One thing you can try is to rename you personal XLB file (the file where Excel stores your personal customizations) so that Excel can't find it when the application interface is started (as part of the Designer in VS). This should cause Excel to generate a new, clean copy. If structural damage in the XLB's binary file format is causing the problem, this would help.






Re: Visual Studio Tools for Office Can only add one Windows Control in design mode in Excel using VSTO

Bertil Emmertz

Hi Cindy

I previously had a problem with menue merging and that was caused by the .xlb-file. At that point I removed the .xlb-file and the menue merging worked, but unfortunately it does not work on my problem when adding controls.

I did the following. I renamed the .xlb-file, brought up VS and created a new Excel Workbook project, created a button control (ok) and then tried to create a second button control (failed). I closed VS and a new .xlb-file had been created.

Thanks for your interest.

BEz





Re: Visual Studio Tools for Office Can only add one Windows Control in design mode in Excel using VSTO

Geoff Darst - MSFT

Hi Bertil,

You might also try deleting the extended typelib for the ActiveX wrapper.  Under your %TMP% directory there should be an Excel directory of some sort.  In that directory you will find a file called Microsoft_VisualStudio_OfficeTools_UnmanagedWrapper.exd.  Delete that file and see if makes a difference.

Sincerely,

Geoff Darst

Microsoft VSTO Team





Re: Visual Studio Tools for Office Can only add one Windows Control in design mode in Excel using VSTO

Bertil Emmertz

Thanks a lot Geoff !

It worked !

BEzt regards