View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.com.add_ins
mike dilworth mike dilworth is offline
external usenet poster
 
Posts: 2
Default OnStartupComplete and activeworkbook

hi all

I have a COM add-in for excel. I want to get the workbook (xls) name when it
loads. So inside
OnStartupComplete i use the valid IDispatch application pointer and query
for the active workbook. Now this works when I click on the xls file
directly, or if i start excel from the command line and pass it the complete
xls file name. However, if I create a shortcut to the xls file and then
start excel by double clicking this the code fails. The workbook is null.

I have noticed that when starting excel in this manner (a shortcut to and
xls file) it is run with the /e flag, which means to start with no workbook.
and I think this is the problem because OnStartupComplete is called before
the xls is actually loaded.



I am wondering if any of you have found this and have a workaround i could
use.



tia



mike