Hi,
Thanks for the suggestion. However, I am starting from VBA and
Application.Run starts Excel again with the same workbook open.
I am told it is possible to place the VBA procedures into a class module and
pass an instance of the class to the VB6 DLL. Unfortunately, that did not
work either because of the following error message:
A property or method call cannot include a reference to a private object,
either as an argument or as a return value.
The code is as follows:
In VBA:
Dim aProcLib As clsGeneral
Set pConnect = New XWarePayroll.Connect
Set aProcLib = New clsGeneral
pConnect.SetExcelProcedures aProcLib The above line causes the above error.
clsGeneral is a class module with one sub procedure(gStartProc).
XWarePayroll is the DLL with class module Connect.
In VB6:
In class module Connect:
Sub SetExcelProcedures(aProcedures)
Set pExcelProcedures = aProcedures
End Sub
pExcelProcedures is a public variable in a module.
Though it never got to this point, the gStartProc procedure would be called
as follows:
pExcelProcedures.gStartProc True