Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Reference problem

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A reference problem - I THINK? Los Excel Discussion (Misc queries) 2 May 13th 08 07:20 PM
Reference problem jesmin Excel Discussion (Misc queries) 4 February 6th 06 02:08 PM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM
Need help with this reference problem No Name Excel Programming 4 August 16th 04 07:57 PM
Another Reference Problem bob Excel Programming 0 August 16th 04 03:47 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"