Question : Midify excel file within visual foxpro 9

Help me
I have one excel file in system, What can I do to modify this excel file with visual foxpro 9 by oExcel = Createobject("Excel.Application")

thank you

Answer : Midify excel file within visual foxpro 9

oExcel = CREATEOBJECT("Excel.Application")
oWorkbook = oExcel.Workbooks.Open(cFilename)
oSheet = oWorkbook.Sheets(1)
oExcel.Visible = .T.
oSheet.Cells(1).Value = "Hello Mom"

You can save a macro in Excel and then convert it to VFP code by changing ActiveSheet to oSheet.

At the end you save and exit

oWorkBook.Save
oExcel.Quit
RELEASE oSheet
RELEASE oWorkbook
RELEASE oExcel
Random Solutions  
 
programming4us programming4us