Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Port OLE object to Excel
Message
From
11/05/2000 15:23:31
 
 
To
11/05/2000 14:28:11
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00368702
Message ID:
00368747
Views:
13
Hi,

Your problem is storing the object in a general field. You need to store it in a binary memo field (codepage=0) and then use Automation to extract it into a file that can be read:

** VBA Code

Dim oVFP as Object
Set oVFP = CreateObject("VisualFoxPro.Application")
oVFP.DoCmd "USE mytable" && Open table
oVFP.DoCmd "LOCATE FOR ..." && Find the record
oVFP.DoCmd "COPY MEMO memofield TO c:\temp\test.vsd"

Now you can do what you want with the file.


>Dear all,
>
>I create a general field to store a ole object (such as a Visio Drawing). I would like to port this object and other data to the excel for printing the report. I try to record a marco on excel (create a ole object on worksheet) and port the code on VFP. But it doesn't work and prompt the error message "Object cannot add", command is work to run on excel. Comamnd as "activesheet.oleobjects.add(FileName:='c:\temp\test.vsd', Link:=False, DisplayAsIcon:=False).select".
>
>What problem on it and how can I print the object? Thank you very mcuh ...
>
>Best Regards,
>
>Justy Chow
>justychow@sinaman.com
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform