Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with VFP dll in Excel
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00463519
Message ID:
00463613
Views:
42
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform