ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Only for experts - please help (https://www.excelbanter.com/excel-programming/376928-only-experts-please-help.html)

Miguel Castanuela

Only for experts - please help
 
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


RB Smissaert

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



NickHK

Only for experts - please help
 
Miguel,
How are communicating between the DLL and Excel ?

What about :
Dim With Events MyObject As clsCustomDLL
and raise an event from the DLL

NickHK

"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





All times are GMT +1. The time now is 03:12 PM.

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