J
Jag Man
I would like to import VBA modules generated by another application into
Excel. That is,
I want to create the module as ordinary text file. To this end, I have
exported a module
that I created in the VB Editor (opened from Excel Tools|Macros menu) just
to see what it
looked like. When I open it in a text editor (e.g., Notepad) I see the
following:
' Declare myFunct as a C++ function in a DLL
Private Declare Function myFunct Lib "myDLL.dll" _
(ByRef inArgs As Double, ByRef outArgs As Double) As Long
'Define a Sub that calls myFunct
Sub myFunctDriver()
Attribute myFunctDriver.VB_ProcData.VB_Invoke_Func = "m\n14" <-----
WHAT IS THIS???
Dim inArgs(1) As Double, outArgs(1) As Double
Dim ec
inArgs(0) = ThisWorkbook.Worksheets("WS1").Range("b6").Value 'x
inArgs(1) = ThisWorkbook.Worksheets("WS1").Range("b9").Value 'y
ec = myFunct(inArgs(0), outArgs(0))
If ec = 0 Then
ThisWorkbook.Worksheets("WS1").Range("h4").Value = outArgs(2) 'z
ThisWorkbook.Worksheets("WS1").Range("h5").Value = outArgs(1) 'w
End If
End Sub
' Another Sub the calls the myFunctDriver
Sub simulate()
Attribute simulate.VB_ProcData.VB_Invoke_Func = "s\n14" <----- WHAT IS
THIS???
Call myFunctDriver
End Sub
This is exactly whst I see in the VB Editor with the exception of the noted
lines (<----- WHAT IS THIS???).
Where does VB get the "m\n14" string? Is it just an arbitrary unique string
for each defined function?
TIA
jagman
Excel. That is,
I want to create the module as ordinary text file. To this end, I have
exported a module
that I created in the VB Editor (opened from Excel Tools|Macros menu) just
to see what it
looked like. When I open it in a text editor (e.g., Notepad) I see the
following:
' Declare myFunct as a C++ function in a DLL
Private Declare Function myFunct Lib "myDLL.dll" _
(ByRef inArgs As Double, ByRef outArgs As Double) As Long
'Define a Sub that calls myFunct
Sub myFunctDriver()
Attribute myFunctDriver.VB_ProcData.VB_Invoke_Func = "m\n14" <-----
WHAT IS THIS???
Dim inArgs(1) As Double, outArgs(1) As Double
Dim ec
inArgs(0) = ThisWorkbook.Worksheets("WS1").Range("b6").Value 'x
inArgs(1) = ThisWorkbook.Worksheets("WS1").Range("b9").Value 'y
ec = myFunct(inArgs(0), outArgs(0))
If ec = 0 Then
ThisWorkbook.Worksheets("WS1").Range("h4").Value = outArgs(2) 'z
ThisWorkbook.Worksheets("WS1").Range("h5").Value = outArgs(1) 'w
End If
End Sub
' Another Sub the calls the myFunctDriver
Sub simulate()
Attribute simulate.VB_ProcData.VB_Invoke_Func = "s\n14" <----- WHAT IS
THIS???
Call myFunctDriver
End Sub
This is exactly whst I see in the VB Editor with the exception of the noted
lines (<----- WHAT IS THIS???).
Where does VB get the "m\n14" string? Is it just an arbitrary unique string
for each defined function?
TIA
jagman