Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export data to excell file with formulas
Message
From
18/03/2002 04:46:11
Wilfred Chan
Bnp Paribas Hong Kong Branch
Hong Kong, Hong Kong
 
 
To
15/03/2002 11:38:02
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00633291
Message ID:
00634002
Views:
15
Hi,

I think the easiest way is to look at the VBA (Visual Basic Editor) help in Excel. Start looking at "Application object".
FYI, oExcel = CREATEOBJECT("Excel.Application")
The oExcel is the application object of Excel. Below are some hence for you.
Action       Command
Open file    oExcel.Workbooks.Open("file")
Save file    oWorkbook.Save("file") / SaveAs
Close file   oWorkbook.Close  (must be closed after using)
Selection    oSheet.Range("A1:C1").Select
Copy         oExcel.selection.copy
Copy range   oSheet.range("A2:A20").select
Paste        oSheet2.paste
Font         oSheet.Cells(1,1).Font.Bold = .T.
Format       oSheet.Columns(1).NumberFormat = "#,##"
AutoFit      oSheet.Columns(1).AutoFit
....         oSheet.RANGE("A:B").EntireColumn.Hidden = .T.
When you work on it, just thinking that you're working in Excel. And try to record the Macro to see how it works.

:) Wilfred


>>
>>:) Wilfred
>
>
>Thks Wilfred,
>This is great, Even with this I will manage what I wanna do :-))
>
>Where could I obtain some sort of list of available object/calls for
>Excell next to those you demonstrated in your message?
>e.g.(Excell)
>Open File (I guess is oExcell.open('C:\myfile'))
>oExcell.Close() ?
>Copy Sheet ?
>Copy Row ?
>Copy Column ?
>Row.set_all('FOX') ?
>Column.set_all('IS GREAT') ?
>How about settings fonts/colors ?
>etc...
>
>I am asking to much ... :-))
>
>Thks big time - you made my day !
>Rgds++
Previous
Reply
Map
View

Click here to load this message in the networking platform