View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Reference problem

Ignore this.
It appeared it was just a corrupted dll file.

RBS

"RB Smissaert" wrote in message
...
Have a commerial .xla add-in and some (2 or 3) customers have come across
a problem that somehow has to do with
References, but I can't understand what the problem is.
I have a VB6 dll, called RCBrowser.dll and this will load a VB6 form and
run some related code.
The reference to this dll is set fine in the add-in, but the .xla behaves
as if this reference is missing.

This is the bit in the .xla code where it falls over:
------------------------------------------------------------------------

Dim clsRCB As RCBrowser.clsRCBrowser
Set clsRCB = New RCBrowser.clsRCBrowser

Set clsRCB.ExcelApp = Application

It falls over at the last line. I haven't got the exact error message, but
it is as if it thinks the reference is missing.


This is the relevant bit (I think) in the VB6 code:
------------------------------------------------------------------------

Option Explicit
Private Const GWL_HWNDPARENT As Long = -8
Private mxlApp As Excel.Application
Private mlXLhWnd As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLong _
Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Public Property Set ExcelApp(ByRef xlApp As Excel.Application)
Set mxlApp = xlApp
mlXLhWnd = FindWindow(vbNullString, mxlApp.Caption)
End Property


Public Sub ShowVB6Form()

Set frmRCB = New frmRCBrowser

Load frmRCB
SetWindowLong frmRCB.hWnd, GWL_HWNDPARENT, mlXLhWnd
frmRCB.Show 0

End Sub


All this worked fine before.
I tried running regsvr32 and I have tried bringing the file MSCOMCTL.OCX
up to date, but all to
no avail.
I am probably overlooking something simple here and not having seen the
troublesome machine myself doesn't help
but I am running out of ideas what could be the problem here.

Thanks for any advice.


RBS