I am trying to call an excel subroutine that is in an add-in that is installed in excel.
Severlal problems ... the first (and biggest) is that even though the add-in is installed, i keep getting errors that the add-in can't be found. The call to the procedure is formatted like this:
Sub ProcessXLFile(FilePath As String, _
Repath As Boolean, _
NewPath As String, _
MakeFiles As Boolean, _
CreateLog As Boolean, _
LogFileName As String)
Dim xlapp As Object
Set xlapp = CreateObject("Excel.Application")
Dim xlbook As Object
Set xlbook = xlapp.Workbooks.Add
Dim xlmodule As Object
Set xlmodule = xlbook.vbproject.vbcomponents.Add(1)
xlapp.Run ("haX2A.xla!PingRemoteTest")
...
after this, I set the module to nothing and clean up normally.
The add-in "haX2A.xla" is installed and is accessible (it has menu functions, toolbars available in Excel). However, when the above code executes in a VB6 app, it opens the instance in Excel normally and I get an error message from Excel VBA that the file "haX2A.xla" could not be found.
Once I get past that problem, I have the need to do more than a test function, obviously. I need to be able to call a sub I have in "haX2A.xla" that will take arguments (I want to pass the arguments that this function in VB is being passed on to the VBA call to the add-in. Anyone know how to call this in a VB run method for the xlapp as indicated above?
I've searched far and wide for something on this and have come up empty.
Thanks, Mac