You are here: Office-Outlook.com  / Outlook Forum

Start Excel from another program / command line throws exception

Home » Outlook addins and plugins development » Developer Outlook add-ins
Start Excel from another program / command line throws exception [message #252029] Tue, 11 December 2007 10:21 Go to next message
XL-Dennis
Messages: 518
Registered: August 2006
Senior Member
Hi,

I got a managed COM add-in for Excel which is available in the VBE when it's
loaded. Everything works as expected when Excel is loaded the normal way. But
when a new instance of Excel is created from another program or when it's
started with the Command line the following exception is throwned:

System.Runtime.InteropServices.COMException(0x800A03EC): Exception from
HRESULT: 0x800A03EC at Excel._Application.get_VBE() at
NETColLibrary.AddinModule.Add_Menu_Items()

Can someone shed some lights over this issue and also guide me how to solve
it?

---------------
With kind regards,
Dennis
Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
My English site: http://www.excelkb.com/default.aspx
My Swedish site: http://www.xldennis.com/
Re: Start Excel from another program / command line throws exception [message #257826] Thu, 13 December 2007 06:15 Go to previous message
andrei dot smolin
Messages: 161
Registered: October 2007
Senior Member
Hi Dennis,

What event do you use to add your menu items? Can you move this code to, say
Workbook_Activate?

If the problem persists, can you create a sample project that reproduce the
problem and send it to me
for testing?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader


"XL-Dennis" <XLDennis@discussions.microsoft.com> wrote in message
news:B405F744-8470-4F8D-9C8D-D78A9E334CF5@microsoft.com...
> Hi,
>
> I got a managed COM add-in for Excel which is available in the VBE when
> it's
> loaded. Everything works as expected when Excel is loaded the normal way.
> But
> when a new instance of Excel is created from another program or when it's
> started with the Command line the following exception is throwned:
>
> System.Runtime.InteropServices.COMException(0x800A03EC): Exception from
> HRESULT: 0x800A03EC at Excel._Application.get_VBE() at
> NETColLibrary.AddinModule.Add_Menu_Items()
>
> Can someone shed some lights over this issue and also guide me how to
> solve
> it?
>
> ---------------
> With kind regards,
> Dennis
> Weekly Blog .NET & Excel: http://xldennis.wordpress.com/
> My English site: http://www.excelkb.com/default.aspx
> My Swedish site: http://www.xldennis.com/
Previous Topic:.NET Add-In and XP vs 2003 PIAs
Next Topic:Excel header/footer - bold, regular, etc
Goto Forum: