Easily done through OLE Automation. To learn about it, there are references in MSDN (Excel's Object Model), plus you can get a copy of an excellent book, "Microsoft Office Automation with isual FoxPro" by Tamar Granor and Della Martin.
Another easy way to learn is to create a recording macro in Excel and do what you want to accomplish. Then look at the generated VBA code from the macro. It does not produce the most efficient code but VBA is easy to translate to VFP and will teach you most of what you need to learn.
To see the generated code, open the VBA project with ALT-F11 and look for Module1 under VBA Project|Modules.
oExcel = CreateObject("Excel.Application")
oExcel.Visible=.t.
oExcel.SheetsInNewWorkBook=3
oWorkbook = oExcel.Workbooks.Add
oWorkbook.Sheets("Sheet1").Select
oWorkbook.Sheets("Sheet1").Name = "MyPage1"
oWorkbook.Sheets("Sheet2").Select
oWorkbook.Sheets("Sheet2").Name = "MyPage2"
oWorkbook.Sheets("MyPage1").Select
oWorkbook.Range("A1").Select
oWorkbook.ActiveCell.FormulaR1C1 = "page 1 - 101"
oWorkbook.Range("B1").Select
oWorkbook.ActiveCell.FormulaR1C1 = "page 1 - 102"
oWorkbook.Sheets("MyPage2").Select
oWorkbook.Range("A1").Select
oWorkbook.ActiveCell.FormulaR1C1 = "page 2 - 201"
You can also see a similar example in the Wiki at:
http://fox.wikis.com/wc.dll?Wiki~AutomationExamples~VFPHTH
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>1. how to crate a Excel file ( that with 3 sheets, as like as the blank worksheet when i run EXCEL )
>
>2. how can i define the number of sheet at that Excel ?
>
>3. how can i define the name of sheet1, sheet2....3
>
>4. after created, how can i change the ACTIVE SHEET ?
> ex. i want to put some value into
> .cell(1,1) = "page 1 - 101" into sheet1
> .cell(1,2) = "page 1 - 102" into sheet1
> .cell(1,1) = "page 2 - 201" into sheet2
> .cell(1,2) = "page 2 - 201" into sheet2
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>