K
Kurt M. Sanger
I'm having trouble calling my activex dll function from Excel.
If I use
Public Function funcR2L(strDonorSetIn As String, strRecipeIn As String) As
Variant
Dim varReturnedAns(4) As Variant
Dim intI As Integer
Dim varAns() As Variant
Dim L2R As Object
Set L2R = New lab2Recipe.VBLab2Click
varAns = L2R.funcRecipe2Lab(strDonorSetIn, strRecipeIn)
I get the error message Run-time error '5' Invalid procedure or argument.
I get the same error with
Dim L2R as lab2Recipe.VBLab2Click
Set L2R = New lab2Recipe.VBLab2Click
varAns = L2R.funcRecipe2Lab(strDonorSetIn, strRecipeIn)
I've tried using the declare statement instead, but then I get an error
stating that the entry point for the function is not found. I saw references
stating that this type of dll must be generated in 'C' but I'm not sure.
I've also tried to create an Object using:
Dim L2R As Object
L2R = CreateObject("lab2Recipe.VBLab2Click")
varAns = L2R.funcRecipe2Lab(strDonorSetIn, strRecipeIn)
Again I get the same error message.
I have set the references to my dll. I have registered my dll. My function
is in a class module called VBLab2Clik in a dll called lab2Recipe.dll defined
as:
Public Function funcRecipe2Lab(strFolderName As String, _
strClickRequest As String) As Variant()
Dim varAns(4) As Variant
Dim intI As Integer
Dim varLabEst As Variant
varLabEst = funcStrClick2Lab(strFolderName, strClickRequest)
For intI = 1 To 4
varAns(intI) = varLabEst(intI)
Next intI
funcRecipe2Lab = varAns
End Function
I used a group with additional forms to call this same function from a VB
program with no problems.
Can anyone tell me what else I need to do? Thanks.
PS, I have a subroutine defined in the class module that works from Excel
using:
Public Sub subClick2ClickList(strRecipeListIn As String, _
strDonorSetIn As String, _
strRecipeListOut As String, _
strDonorSetOut As String, _
strSpecialSetting As String)
Dim L2R As VBLab2Click
Set L2R = New VBLab2Click
L2R.subRList2RList strRecipeListIn, strDonorSetIn, _
strRecipeListOut, strDonorSetOut, strSpecialSetting
End Sub
If I use
Public Function funcR2L(strDonorSetIn As String, strRecipeIn As String) As
Variant
Dim varReturnedAns(4) As Variant
Dim intI As Integer
Dim varAns() As Variant
Dim L2R As Object
Set L2R = New lab2Recipe.VBLab2Click
varAns = L2R.funcRecipe2Lab(strDonorSetIn, strRecipeIn)
I get the error message Run-time error '5' Invalid procedure or argument.
I get the same error with
Dim L2R as lab2Recipe.VBLab2Click
Set L2R = New lab2Recipe.VBLab2Click
varAns = L2R.funcRecipe2Lab(strDonorSetIn, strRecipeIn)
I've tried using the declare statement instead, but then I get an error
stating that the entry point for the function is not found. I saw references
stating that this type of dll must be generated in 'C' but I'm not sure.
I've also tried to create an Object using:
Dim L2R As Object
L2R = CreateObject("lab2Recipe.VBLab2Click")
varAns = L2R.funcRecipe2Lab(strDonorSetIn, strRecipeIn)
Again I get the same error message.
I have set the references to my dll. I have registered my dll. My function
is in a class module called VBLab2Clik in a dll called lab2Recipe.dll defined
as:
Public Function funcRecipe2Lab(strFolderName As String, _
strClickRequest As String) As Variant()
Dim varAns(4) As Variant
Dim intI As Integer
Dim varLabEst As Variant
varLabEst = funcStrClick2Lab(strFolderName, strClickRequest)
For intI = 1 To 4
varAns(intI) = varLabEst(intI)
Next intI
funcRecipe2Lab = varAns
End Function
I used a group with additional forms to call this same function from a VB
program with no problems.
Can anyone tell me what else I need to do? Thanks.
PS, I have a subroutine defined in the class module that works from Excel
using:
Public Sub subClick2ClickList(strRecipeListIn As String, _
strDonorSetIn As String, _
strRecipeListOut As String, _
strDonorSetOut As String, _
strSpecialSetting As String)
Dim L2R As VBLab2Click
Set L2R = New VBLab2Click
L2R.subRList2RList strRecipeListIn, strDonorSetIn, _
strRecipeListOut, strDonorSetOut, strSpecialSetting
End Sub