Dear Todd Not sure what's going on here. I recommend you pass the sheet object through as a Variant* (OleVariant) in Delphi. Personally I find that variants play nicer with Microsoft's objects.
I would do something like this Dim x as MyLibrary.MyClass Set x = new MyLibrary.MyClass x.Init ActiveSheet If you're trying to automate Excel from Delphi, you can instantiate and automate Excel directly from Delphi without having to pass objects backwards from Excel to Delphi. Stephen > -----Original Message----- > From: Todd Martin [mailto:[EMAIL PROTECTED] > Sent: Monday, 21 July 2003 3:41 p.m. > To: Multiple recipients of list delphi > Subject: Re: [DUG]: Any COM Experts > > > Thanks Stephen > > I've got the object instantiating okay now. Its been a while > since I used VBA. > > Now I have another problem. At present the only method in my > server object takes a single IDispatch parameter, so I can > get a handle on the MS application inside my server object. > This gets translated as Init(ASheet as > Object) in the type library, but when I try to pass the > active sheet as a parameter from Excel I get the error > "object doesn't support this property or method", yet the > method shows up in the VB object browser and it compiles > okay. Any ideas? > > Todd. > > ----- Original Message ----- > From: "Witherden, Stephen" <[EMAIL PROTECTED]> > To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> > Sent: Monday, July 21, 2003 2:48 PM > Subject: RE: [DUG]: Any COM Experts > > > Dear Todd > > The classname is usually a string referring to your object, > rather than the GUID. > > For example: > > CreateObject("MyLibrary.MyClass") > > But this requires variants and dirty late binding. > > An easier way to create COM objects (with what I think is > early binding) in Excel is as follows: > > 1. In Excel, open the VB editor (Alt + F11) > 2. Open the Object Browser (F2) > 3. Right Click on the "All Libraries" combo box and click > "References..." 4. Find your object in the list and check it > > If you don't see it in the list, try clicking "browse..." and > find your dll on the file system. > > If you can't find your object in the list it is probably not > registered, register it with Regsvr32.exe or in Delphi. > > 5. Use the "All Libraries" dropdown box to select your library > > You should now be able to browse your objects and instantiate > them natively in Excel using their real names. > > Dim x As MyLibrary.MyClass > Set x = New MyLibrary.MyClass > > > -----Original Message----- > > From: Todd Martin [mailto:[EMAIL PROTECTED] > > Sent: Monday, 21 July 2003 2:20 p.m. > > To: Multiple recipients of list delphi > > Subject: [DUG]: Any COM Experts > > > > > > Hi all > > > > I've created a COM server object (*.dll) which I want to use in an > > Excel. So I was trying to use VBA CreateObject() with the COM > > interface GUID as the string parameter, but that doesn't work. > > > > Do I need to creat an Automation Server object instead and somehow > > register a class name for the dll in order to create it in > a MS Office > > application? > > > > Thanks, > > Todd. > > > > > > -------------------------------------------------------------- > > ------------- > > New Zealand Delphi Users group - Delphi List - > > [EMAIL PROTECTED] > > Website: http://www.delphi.org.nz > > To UnSub, send email to: [EMAIL PROTECTED] > > with body of "unsubscribe delphi" > > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > > > -------------------------------------------------------------- > ------------- > New Zealand Delphi Users group - Delphi List - > [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > > > -------------------------------------------------------------- > ------------- > New Zealand Delphi Users group - Delphi List - > [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/