Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add-ins don't load when using automation

Status
Not open for further replies.

LFB

Programmer
Jul 2, 2001
38
AU
Hi All,

Win2k, VB 6 (sp4), Excel 2000.
References: Microsoft Excel 9.0 Object Library

When I fire up a session of Excel from VB, it opens without including any add-ins or macro's or anything.

The KB article Q213489 says that XL will send a message to VB to wait a bit while it loads all the add-ins and files located in the XLStart, but VB cannot handle the request and continues with the rest of the commands.

The article then goes on about how this is a 'good' thing because you can control the add-ins to inlcude.

It doens't go on to say what you can do if you don't want this to happen.

The code in my app is supposed to be generic, therefore I cannot specify what add-ins to include, this will be left to the user. I need to make sure the add-ins are loaded when I call Excel.

The only thing I have tried is the DoEvents after my line of code that gets Excel:

Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Add
DoEvents

This is meant to pass control back to the OS, I thought this would allow Excel to load normally but it is still the same.

Can anyone offer some alternate code that allows Excel to load normally? The only thing I found that works is to Shell Excel, but I don't want to include that in my code.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top