Error loading DLL - XL2003

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Error loading DLL - XL2003

Post by AlanMiller »

I'm transferring a workbook from an XP -> XP box. It references a custom DLL and all worked OK on the old box. But this has me beat. I get the Error in loading DLL (Error 48) but I can see all of the DLL classes and their members in the Object Browser. XL can obviously see the reference and can see the entry points. But it can't "load" the DLL????????? I must admit to being a bit rusty on my XL VBA, so maybe I'm missing something (hopefully :crossfingers:) obvious.

Alan

User avatar
Jan Karel Pieterse
Microsoft MVP
Posts: 656
Joined: 24 Jan 2010, 17:51
Status: Microsoft MVP
Location: Weert, The Netherlands

Re: Error loading DLL - XL2003

Post by Jan Karel Pieterse »

Has the dll been registered with windows?
Regards,

Jan Karel Pieterse
Excel MVP jkp-ads.com

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Re: Error loading DLL - XL2003

Post by AlanMiller »

Jan Karel Pieterse wrote:Has the dll been registered with windows?
Yep. Like I said, it appears in the object browser plain as day. This is the initialization code when the workbook opens:

Code: Select all

Option Explicit

    Public nscSebacs    As NamesColl
    Public blnVarsOK    As Boolean
    Public SebacsIni    As INIAPI
    Public SebacsParams As DocParams
    Public allNames     As NameScope
    Public ColHdr
    

Public Sub StartUp()
    Dim i   As Integer
    
    'Create a namescope object for the nsNames table
    Set allNames = New NameScope
    allNames.Init ThisWorkbook, Names("nsNames") 'This call generates the error
It seems that all the declarations are understood for the classes in the DLL, but an error occurs when I call the NameScope.init procedure in the DLL. Got me stumped!

Alan

User avatar
HansV
Administrator
Posts: 78490
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Error loading DLL - XL2003

Post by HansV »

Could the DLL reference another DLL that is not present on the "target" PC?
Best wishes,
Hans

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Re: Error loading DLL - XL2003

Post by AlanMiller »

HansV wrote:Could the DLL reference another DLL that is not present on the "target" PC?
I don't believe so, but I'll have to scour the code of all the classes I think, and go through with a fine-toothed comb. Unfortunately I don't have the DLL build source, just the code for all the classes it contains... maybe a rebuild job. But something you might know in the meantime. I have unlocked the VBA project for viewing (works OK) but each time I open the workbook and use the Tools -> References menu in the VBE, I still get the password prompt. Any way to get rid of this prompt?

Alan

User avatar
HansV
Administrator
Posts: 78490
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Error loading DLL - XL2003

Post by HansV »

I know of only one password for the Visual Basic Project, I don't know what would cause a password prompt if you select Tools | References.
Best wishes,
Hans

User avatar
Jan Karel Pieterse
Microsoft MVP
Posts: 656
Joined: 24 Jan 2010, 17:51
Status: Microsoft MVP
Location: Weert, The Netherlands

Re: Error loading DLL - XL2003

Post by Jan Karel Pieterse »

Did you actually remove the password from the boxes?
Regards,

Jan Karel Pieterse
Excel MVP jkp-ads.com

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Re: Error loading DLL - XL2003

Post by AlanMiller »

Jan Karel Pieterse wrote:Did you actually remove the password from the boxes?
No, I hadn't, but that did the trick. I never realized that... I thought of that dialog as simply a sort of on/off for project access. Obviously the checkbox just affects viewing of the project, but the presence of a password protects against changes. Is that correct?

Alan

User avatar
HansV
Administrator
Posts: 78490
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Error loading DLL - XL2003

Post by HansV »

AlanMiller wrote:Is that correct?
Yes, indeed.
Best wishes,
Hans