I have written an ActivX dll in VB and I want to call this dll from an Excel Makro. But I want to give an Handle of the actuell Excel to a function of the Dll, so that if I have more than one Excel open, the dll knows which Excel it should use.

I have tried it like this:

In the Dll:
public sub MyFunction(hWnd as Object)

In the Makro:
Dim Item As New MyDll.Class
Item.MyFunction (Excel.Application)

But it doesn't work. Has anyone done something like this.

Please help.
mfg Pueromane