set path for Application.Run

Z

zSplash

I have an addin with userforms that I am trouble accessing. I have tried
the following code:
Application.DefaultFilePath = "C:\Documents and
Settings\Username\Application Data\Microsoft\Addins\"
Application.Run "MyAddin.xla!TL.ShowUserform1"

I get "Run-time error 1004" - "'MyAddin.xla could not be found..."

Any suggestions, guys?

TIA
 
J

Jim Rech

MyAddin.xla is open right? If not, it has to be open before you can run
code in it. No reason to change the default file path, in fact, it's a bad
idea unless this is just for you. Users generally don't appreciate you
changing their preferences.
 
T

Tom Ogilvy

in the addin have a sub that shows Userform1

Public Sub Showform()
Userform1.show
End sub


sPath = "C:\Documents and Settings\Username\" & _
"Application Data\Microsoft\Addins\"
Application.Run sPath & "MyAddin.xla!Showform"
 
Top