Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling Excel from within VFP
Message
From
12/12/2001 07:50:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/12/2001 01:55:29
Kam Lee
SUNY-Health Science Center
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00593112
Message ID:
00593173
Views:
21
>Hi all,
>
>Where can I find a complete obect model for MS Excel? I like to manipulate
>Excel from within VFP like opening an existing spreading sheet, retrieving
>cells' value and etc...
>
>Or anybody can give a few pinters to get me started ?
>
>Thanks.
>
>Kam.

What I usually do is save a macro in Excel, for whatever I plan to do (say, bold, borders, change column width, etc.). The commands can then easily be adapted to VFP.

The following primitive sample may help you get started:
oExcel = CreateObject("Excel.Application")
oExcel.Visible = 1   && for debugging
oExcel.Workbooks.Add()
oSheet = oExcel.ActiveSheet
oSheet.Cells(1,1) = "Hello!"
Afterwards, use the "macro" approach.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform