ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003 vsto 2005 vb.net - ThisAddIn_Startup problem (https://www.excelbanter.com/excel-programming/437871-excel-2003-vsto-2005-vbulletin-net-thisaddin_startup-problem.html)

Richardb

Excel 2003 vsto 2005 vb.net - ThisAddIn_Startup problem
 
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.



joel[_440_]

Excel 2003 vsto 2005 vb.net - ThisAddIn_Startup problem
 

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.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=165901

Microsoft Office Help



All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com