View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Isabelle Robin Isabelle Robin is offline
external usenet poster
 
Posts: 4
Default how to know if a xla is 'loaded'

Hi to all,

I found the solution :

Private Sub Workbook_Open()
If CommonExist("common") Then
MsgBox "common exists"
Else
MsgBox "comon doesn't exists"
End If
End Sub

Function CommonExist(refName As String)
CommonExist = False
For Each objReferences In Workbooks("1.xls").VBProject.References
If LCase(objReferences.Name) = refName Then
CommonExist = True
End If
Next objReferences
End Function

Best regards

Isabelle Robin wrote:

Hi,

In fact I have created a xla file and now an excel file has a reference to
this xla file.
With your code, I only see (I think) the installed addins.
But with my xla file, I have done nothing so I can't see it.
The goal is that some people, when they will have access to this xla file,
will have all buttons visible, instead of other people, if they don't have
this xla file, some button will be invisible.
So my question could me : how can I know the checked references in the Tools
menu.

thanks for your answer

Bob Phillips wrote:

Hi Isabelle,

There is an addins collection that you can test. This returns all addins
available to Excel, so you need to test the installed property, like so

For Each oai In Application.AddIns
If oai.Installed = True Then
Debug.Print oai.Name
End If
Next

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Isabelle Robin" wrote in message
...
Hi to all,

I search how to know if an a reference to a xla file is active, in a xls
file.

Do you have some advice ?

thks a lot