Only for experts - please help
I have it like this:
In the VB6 app module:
Public oXLApp As Object
In the VB6 class module I have this code fragment, which shows what is going
on:
Option Explicit
Private Const GWL_HWNDPARENT As Long = -8
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 Sub ShowVB6Form(oXL As Object, _
Optional strReadCode As String, _
Optional strTermText As String)
Dim lHwnd As Long
Set frmRCB = New frmRCBrowser
Set oXLApp = oXL
lHwnd = FindWindow("XLMAIN", oXLApp.Caption)
With frmRCB
Load frmRCB
SetWindowLong .hWnd, GWL_HWNDPARENT, lHwnd
.Show 0
If Len(strReadCode) 0 Then
.optButton(2).Value = True
.txtBox(1).Text = strReadCode
bSearchButton = False
oXLApp.Run "ReadCodeBrowser.xla!Module1.DoSearch"
etc.
RBS
"Miguel Castanuela" wrote in
message ...
Actually I have an reporting "system" based solely in Excel, implemented
through
an Workbook_Open, a Sub ProcessReport, custom controls in a worksheet
and so on. I pretend migrate the custom controls to a VB6 (front loader),
specifically a VB6 dll (see chapter 20 of "Professional Excel
Development",
of Bullen, Bovey & Green). Ok, suppose i have the form communicating
"two-ways"
with the ExcelApp, my question is, how to call the macro ProcessReport
from
the
cmdProcess_click in the form of the VB6 dll?
Thanks in advance,
Miguel Castanuela
|