Information générale
Catégorie:
COM/DCOM et OLE Automation
Hi Barbara,
>I don't know for sure, but could it be that the SECOND time you already have the oTest object? You might try deleting it in your macro or else checking to see if it exists before calling CreateObject()
>
>I've run into similar problems with Word....
Thanks for the reply.
I've tried the following code:
Sub reftest()
Dim oTest As Object
Set oTest = CreateObject("refgen.ref_finder")
cName$ = oTest.getref("substanc", "numb", "AZZZD", 1)
Set oTest = Nothing
MsgBox (cName)
End Sub
The code still fails if I run it a second time. The line causing the error is the second line, with oTest being an Object and having a value of Nothing at this stage during both runs.
This is really a show-stopper. I've tried it in Excel and VB with the same result. Yet, it works great if the dll is used in VFP.
I couldn't figure out how to release a variable in VB, but oTest is local to reftest() and I assume the code would error on the first line if oTest already existed.
Best.
Matt.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement