False message .xla already open

R

RB Smissaert

Trying to solve somebody's .xla add-in problem and have come across a
strange thing.
This is the sequence:
One .xla loaded and shows with tick in Tools, Add-ins.
Un-tick this and close Excel
Re-start Excel
Tools, Add-ins, Browse to same add-in and do OK.
Then the message appears: add-in already opened.
When you look in the VBE that file is not opened.
Looked in the registry under
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options\
and that .xla doesn't show there. Looked under lower Excel versions as well
and file doesn't show in one of
the Open keys.
So why this message?
The actual problem with this person shows somewhere else, but it seems that
this is an indicator that
somehow/somewhere there is something seriously wrong here.
The problem is I can't see this computer, so I have to solve it via e-mail
and phone and that is not that easy.

Any suggestions?

RBS
 
P

Peter T

Hi Bart,

Wonder if you are getting accurate details from your user
Then the message appears: add-in already opened.

Are you sure this is the actual message and not -
'A file named blah already exists in that location, do you want to replace
it"

This may occur whether or not the file is loaded but in the addins
collection, eg nearby in the registry under

\Excel\Addin Manager

Another possibility is two addins with same 'Title' but different names
exist in the same folder. The one with the unexpected name, not listed as an
addin, might get loaded.

If you get hooked up with Rob's suggestion try this -

Option Explicit
Option Compare Text

Sub test()
Dim i&
Dim sDef1$, sDef2$, s$
Dim adn As AddIn
Dim wb As Workbook
Cells.Clear

sDef1 = Application.UserLibraryPath
sDef2 = Application.LibraryPath
Cells(1, 6) = sDef1
Cells(2, 6) = sDef2
i = 3
For Each adn In Application.AddIns
i = i + 1
With adn
If .Installed Then
Cells(i, 2).Value = "Installed"
If Len(.Path) Then
'ignore MS system addins without path
On Error Resume Next
Set wb = Application.Workbooks(.Name)
Cells(i, 1) = IIf(wb Is Nothing, "missing", "loaded")
On Error GoTo 0
Set wb = Nothing
End If
End If

Cells(i, 3).Value = .Title
Cells(i, 4).Value = .Name
s = ""
If .Path & "\" = sDef1 Then
s = "Def Path 1"
ElseIf InStr(1, .Path, sDef1) Then
s = "Def Path 1 sub"
ElseIf .Path & "\" = sDef2 Then
s = "Def Path 1"
ElseIf InStr(1, .Path, sDef2) Then
s = "Def Path 2 sub"
ElseIf Len(.Path) = 0 Then
s = "system"
End If

Cells(i, 5).Value = s
Cells(i, 6).Value = .FullName
End With
Next
Columns("A:E").EntireColumn.AutoFit
End Sub

Regards,
Peter T
 
R

RB Smissaert

Hi Peter,

Yes, you are right, except it was me who forgot what the exact message was.
Another possibility is two addins with same 'Title' but different names
exist in the same folder

What do mean with title and what with name?
We went through the registry and that seemed OK.

Maybe this is another one to check:
In Excel, choose Tools >Options.
On the General tab, make sure "Ignore Other Applications" is not checked
from: http://contextures.com/xlfaqApp.html#AlreadyOpen

Got a few leads now. If all else fails then maybe an Excel reinstall will
fix it.

RBS
 
P

Peter T

Hi Bart,
What do mean with title and what with name?

Addins are referenced in the addins collection by .Title (not .Name), also
the title appears in the dropdown list.

If an addin has been renamed the title can remain in the list and in the
addin's collection. When reinstalled user might be looking for the original
Named file to be loaded rather than the renamed file.

This is only relevant if a Title exists in File > Properties > Title,
otherwise .Title defaults to .Name.

Another thought, does the problematic addin have code that uninstalls or
unloads itself under a given scenario, I have one of those.

In the example code I posted I was very careless with separators. I'm sure
you would have picked it up but for others -

If right(sDef1,1) <> application.pathseparator then
sDef1 = sDef1 & application.pathseparator

Similarly with sDef2

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top