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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Add-Ins 1

Status
Not open for further replies.

TomCarnahan

Programmer
Dec 7, 2002
123
US
I do most of my work in MS Access/VBA, but some of the work I do involves Excel/VBA.

One problem I have had in BOTH applications is that on loading, some quirk of the operating system I have at work, the wrong "add-ins" (in MS Access; "references") get "linked". In simpler terms, my applications plug into the wrong libraries/DLLs.

In MS Access, I found some information on "disambiguation" that basically says, start MS Access with a minimal procedure that has all references explicitly declared (e.g. Dim db as DAO.Database, Dim frm as Access.Form, etc.)
The first thing the procedure does is disconnect from all "add-ins/references" that are NOT built in. Then, it reads from a table and connects to the correct libraries and DLLs.

The problem I have is that in Excel, the nomenclature to do this is different and does not have the same methods available in MS Access.

Does anyone know how to start up Excel, disconnect all "add-ins", then load only pre-determined "add-ins" while avoiding errors due to syntax not being recognized?

Thanks ahead of time for any help you can provide.



--- Tom
 
Hi,

this could help you

add this to your autoexec code

This unloads the addInn

AddIns("Name of addInn").Installed = False

This loads the AddInn

AddIns("Name of addInn").Installed = True

 
Part of the problem with unloading an Add-in is that when I port the Excel file from one LAN to another (yes, we have 2), some aspect of the OS or LAN OS arbitrarily installs add-ins, that usually conflict with the ones I need, but I don't know ahead of time what their name is.

[dazed] ... I have run out of ideas at this point.



--- Tom
 
Hi,
maybe this can be of use. with following code you should retrieve all loaded add-inns

Sub DisplayAddIns()
Worksheets("Sheet1").Activate
rw = 1
For Each ad In Application.AddIns
Worksheets("Sheet1").Cells(rw, 1) = ad.Name
Worksheets("Sheet1").Cells(rw, 2) = ad.Installed
rw = rw + 1
Next
End Sub

after this you could easely set their Installed property to false.

You should do this in an autoexec sub before you actually load your own code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top