Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automating Excel, Wordpad, Notebook etc.
Message
From
07/05/2004 02:44:39
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00901660
Message ID:
00901844
Views:
49
>It's one thing to be able to get, say, an Excel w/s up, it's another to be know what the commands are. for example, I can get Excel to start from VFP but how do I know what the commands are to, say, open a particular w/s, move to cell(A,13).
>
>Essentially I need to open up certain Excel w/s or CSV files (in either Excel or a text editor). How do I get a list of valid commands, etc., within those app's, so as to make them do my bidding?
>
>TIA

Having to deal to similar problems I created Excel automation class library
for common automation tasks. You can find it here at downloads section under
title 'rep2excel'.

It let's you manipulate excel file as 2&3D array.

local oXL
oXL=createobject('write_2_excel')
oXL.open_excel(cExcelTemplateFile) && .f. to start from scratch
*************************
oXL.make_cell(1,5,15, 'Hi There' )
oXL.draw_box(5,15, 5,16, nColor)
oXL.box_set_font(5,15, 5,16 ,'Arial',8,.t.)

oXL.values_in_row(1,4,2,"First Name |Last Name|Address|City|Hire Date")
oXL.table_in_section(1,5,2,'Employee',"Employee.first_name|Employee.last_name|Employee.address|Employee.city|Employee.hire_date")
oXL.array_in_section ....

etc
.
oDev.close_excel()

This is good for 'dummy' automation tasks. Source is included so you can freely customise / extend it's fuctionality.

See also 'CodeRep' for reporting to txt/pdf/excel in code.
You might find it interesting.

Hope this helps you.
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform