>COMRETURNERROR() seems to require you to provide an error message. I'm not sure how that is supposed to work - the object is failing to >instantiate second time around, but exactly the same code works first time around.
Does it crash if you close Excel after each cycle, then re-open and fire again?
I was thinking that Excel migh offer something similar to 'ON ERROR'. Then, in your VFP class container, you might be able to use a generic error procecedure. This one works inside a CUSTOM container (but the client is VFP).
PROCEDURE ERROR(errornumber, DESCRIPTION, scode, SOURCE, helpfile, HELPCONTEXT, fcanceldisplay)
COMRETURNERROR(DESCRIPTION,"VFP DLL Error")
ENDPROC
But for this to be helpful, Excel needs an ERROR handler SUB for the macro.
Is VFP still running when you release the COM? I'll fool around with it some and see what I can see!
>This DLL will eventually be used in a web server. It's really annoying when you get an error but no meaningful error message. I've tried using the object in VB, but I get the same error. VFP can use the DLL with no problems.
>
>Best.
>
>Matt.
Imagination is more important than knowledge