ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "Error in loading DLL", VB6 ActiveX DLL (https://www.excelbanter.com/excel-programming/367022-error-loading-dll-vb6-activex-dll.html)

scott

"Error in loading DLL", VB6 ActiveX DLL
 

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!


moon[_4_]

"Error in loading DLL", VB6 ActiveX DLL
 

Maybe it's a stupid question, but is your dll located in the SYSTEM32
folder?



"Scott" schreef in bericht
...

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!




scott

"Error in loading DLL", VB6 ActiveX DLL
 

No, it isn't but I just put it there and changed the reference.
Unfortunately, I received the same result. Thanks for the idea.

"moon" wrote:


Maybe it's a stupid question, but is your dll located in the SYSTEM32
folder?



"Scott" schreef in bericht
...

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!





NickHK

"Error in loading DLL", VB6 ActiveX DLL
 
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

"Scott" wrote in message
...

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!




scott

"Error in loading DLL", VB6 ActiveX DLL
 
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.


"NickHK" wrote:

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

"Scott" wrote in message
...

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!






NickHK

"Error in loading DLL", VB6 ActiveX DLL
 
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

"Scott" wrote in message
...
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.


"NickHK" wrote:

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

"Scott" wrote in message
...

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!









All times are GMT +1. The time now is 05:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com