Dave:
Here is the audo_open subroutine as I inplemented it
#######
Sub Auto_Open()
Dim homeShare As String
Dim addInPath As String
Dim addInName As String
Dim AddInFullName As String
Dim myWkbk As Workbook
homeShare = Environ("USERPROFILE")
addInPath = "\Application Data\Microsoft\AddIns\"
addInName = "tsttbltoolbar.xla"
AddInFullName = homeShare + addInPath + addInName
MsgBox (AddInFullName)
Set myWkbk = Nothing
On Error Resume Next
Set myWkbk = Workbooks(addInName)
On Error GoTo 0
If myWkbk Is Nothing Then
MsgBox ("Opening the toolbar")
'open it
Workbooks.Open Filename:=AddInFullName
End If
End Sub
#######
I have verified that the pathname I build is correct for the add-in file,
and that the logic works: the if statement succeeds and the Open logic
executes. However, the toolbar doesn't appear.
I can't see what I have done wrong. Can you.
Again, thank you for all your help.
--
Barry Carroll
(Cleverly disguised as a responsible adult)
---------
PSC Scanning, Inc. assumes no responsibility whatsoever for any statements
made by me. I''m entirely on my own.
Dave Peterson said:
You can have a procedure that looks to see if your addin is already open. If
it's not, then open it. If it is, don't do anything more.
Option Explicit
Sub Auto_Open()
Dim myWkbk As Workbook
Set myWkbk = Nothing
On Error Resume Next
Set myWkbk = Workbooks("book1.xla")
On Error GoTo 0
If myWkbk Is Nothing Then
'open it
Workbooks.Open Filename:="C:\my documents\excel\book1.xla"
End If
End Sub