Excel 2003 vsto 2005 vb.net - ThisAddIn_Startup problem

R

RichardB

Hello,

I have an add-in that works well and executes the me.startup event perfectly
when Excel is started manually.

If Excel is started by double clicking an .xls file, the add-in fails to
start and becomes disabled. The xls file then loads. I can re-enable the
add-in and it executes me.starup fine.

I found that when I strip much code back in me.startup the add-in can start
sucessfully when double clicking an .xls file to open Excel.

There does not appear to be any 'offending code' that causes the problem, it
appears to be more along the line of timing.

Thanks for considering this problem.
 
J

joel

You need to isolate the problem futher. There can be differences in how
a macro is executed based on how th e file is opened. For example, the
active sheet may not be the same. Hre are some suggestions

1) Change you security level to medium t make sure the security level
is not set to high where the macro will not run

2) Change your error handling to Stop on all errors. You may be
skipping over some errors that will give you a clue to your problem

VBA menu - tools - OPtions - General - Error Trapping - Stop on all
Errors

3) Comment out all your On Error statements so the code will stop on
the error and tell you where the error is occuring

4) To help isolate the problem Add STOP statements in the code. You
can press F5 to continue past the stop statement. I usually debug
problems that occur when workbooks are opened by placing STOP at the
beginning of the workbook open macro. Then see if the problem still
occurs. Then add more stops until I isolated the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top