LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default How to wait for addon to load

presented the following explanation :
In the initial message in this thread I stated:
"In the ThisWorkbook module of a spreadsheet I have the statement:
AddIns("RollForm").Installed = True
The next line calls a sub in RollForm.xla."

Maybe that was poor terminology and thus not clear. However I meant that
it is in "Private Sub WorkBook_Open()" in ThisWorkbook. The WorkBook_Open()
does run. The .xla is loaded. The problem is that Excel did an implicit
(not coded by me) call Auto_Open() in the .xla which did not exist.

Any way adding the suggested code:
AddIns("RollForm").Installed = False
AddIns("RollForm").Installed = True
Application.OnTime Now + timeSerial(0,0,1), "Continue_Open"
dis solve the problem. It no longer calls Auto_Open() and everything iw
working great. I have no idea why it was calling Auto_Open, and given that
it did, I have no idea why it isn't now.


Excel will look for and call Auto_Open if there's no Workbook_Open proc
in ThisWorkbook. If you use Workbook.Open and have an Auto_Open proc
then you MUST tell Excel to Run that after opening. If you use
Workbook_Open then you don't have to do anything after opening.

When the addin is a member of the Addins collection, you also don't
need to do anything if you use its Installed prop to open it. In this
case Excel will look for Workbook_Open or Auto_Open on its own. That's
just normal behavior when dealing with XLAs because Excel expects an
XLA to have one or the other of these two procs as its startup routine.
It's not a requirement, though, that all XLAs require either one.

What I'm say is instead of calling the proc you call after opening the
addin, put that proc's code in either the Workbook_Open event proc or
an Auto_Open proc so you don't have to call it from wherever you're
calling it from. It appears that whatever this proc is, that you want
it to run immediately after the addin opens. So.., you can make this
proc one of the two startup procs mentioned OR call it from one of
those right within the addin.

--
Garry

Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Remove addon dk New Users to Excel 2 January 11th 08 12:50 AM
Addon program for excell to locate muliple entries in a list stef Charts and Charting in Excel 0 May 19th 06 01:25 PM
Excel addon for Mac Visual.Scholar New Users to Excel 1 February 2nd 06 07:27 PM
addon to equation Micayla Bergen Excel Discussion (Misc queries) 6 August 12th 05 05:38 AM


All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"