I did some searching and
found this which looked promising for using the VBA Project name rather than the filename but I couldn't get that to work anyway.
I did get it going by adding a Reference pointing at the addin (shown via its VBA project name) and dropping the project name from the command that calls it.
Code:
Sub RunATest()
'Include a reference to the addin's VBA project name (TestAddin)
Application.Run "TestAddin!ShowMessage", "Specifying the Project Name fails" 'failed
Application.Run "modName.ShowMessage", "Including the addin's module name works" 'worked
Application.Run "ShowMessage", "Being even less specific works too" 'worked
End Sub
My addin contained a Public Function - you may need to make it Public as well. The code in the addin for my test was
Code:
Option Explicit
Public Function ShowMessage(sMsg As String)
MsgBox sMsg
End Function
Sub aTest()
ShowMessage "hello world"
End Sub