>Hi all,
>
>I need to generate a report from VFP and save that report to a excel format files. How can I do this?
>
>Linda
Linda,
If you use automation, you have control over every detail.
I will provide a simple sample program, to show you how to get started. The sample program below will open Excel, add a spreadsheet, and place some text in cell A1.
I prefer to refer to cells by row and column
numbers - these are easier to manage with a program than references of the "A1" type. Note that the row is specified first.
After that, if you want to do anything else with Excel, record a macro, and do something. Look at the generated code - it can be easily adapted to VFP.
And, of course, feel free to ask back for further details.
Hilmar.
oExcel = CreateObject("Excel.Application")
oExcel.Visible = 1
oExcel.Workbooks.Add()
oSheet = oExcel.ActiveSheet
oSheet.Cells(1,1).Value = "Hello!"
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)