"Error in loading DLL", VB6 ActiveX DLL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If anyone can help me, I will be very appreciative.

I've written an ActiveX DLL that has mysteriously stopped working on my
development machine but works fine on another test machine. Each machine has
the same version of Excel (i.e. 2003) and is running the same dll and xls
file. However, on the development machine, the code will execute in debug
mode without errors (reference made to vbp file vs dll). I have tried a lot
of things to resolve the issue: OS LiveUpdate, Office Update, delete dll from
registry, register / unregister dll via regsvr32, checked dll using
Dependency Walker, etc but nothing has helped. Ideas anyone? Thanks!
 
No, it isn't but I just put it there and changed the reference.
Unfortunately, I received the same result. Thanks for the idea.
 
Scott,
By "the code will execute in debug mode without errors", you mean in the VB6
IDE ?
And in Excel, you set a reference to the DLL ?
Instantiate the object ?

A bit more info the error/not working may help us.

NickHK
 
The code executes just fine if I run the VB6 project and then set the Excel
reference to the .vbp file vs the dll.


The Excel VBA code to call the dll class module is the following:

‘SeayCAD.dll is the name of the dll

Dim clsProjectInfo As SeayCAD.C_ProjectInfo

Private Sub CommunicateToDLL_ProjectInfo()
Set clsProjectInfo = New SeayCAD.C_ProjectInfo
Set clsProjectInfo.ExcelApp = Application
End Sub


When I debug the Excel VBA code, it highlights the “ExcelApp†property and
shows the “Error in loading dll†message box.


The VB6 dll code for the ExcelApp property is the following:

Public Property Set ExcelApp(ByRef xlApp As Excel.Application)
Set mxlApp = xlApp
End Property


Hopefully, this will give you more to go on! Thanks.
 
Scott,
This works for me, which is the same as your code:

'<cXLTest Class module in Test.DLL>
'Reference set to Excel
Dim XLApp As Excel.Application

Public Property Set ExcelApp(vData As Excel.Application)
Set XLApp = vData
MsgBox "Excel set"
End Property

'<Code in Excel WS>
'Reference set to Test.DLL
Dim NewObj As Test.cXLTest

Private Sub CommandButton1_Click()
Set NewObj = New Test.cXLTest
Set NewObj.ExcelApp = Application

Set NewObj.ExcelApp = Nothing
Set NewObj = Nothing
End Sub

But from the error you get, it seems that error is not related to this, as
the dll is not loaded properly.
What about code in Initialise and/oe Sub Main routine ?

NickHK
 
Back
Top