>Hi,
>
>How could I go about update specific cell in Microsoft Excel thru VFP?
>All I want to do is to create a form with two textbox(One for the Row, One for Column) and a button. By pressing on the button it will auto update the excel's row & column with the new values (two textbox).
>
>The other solution I need is to select specific sheet from the spreadsheet. Any help or suggestion will be appreciated.
>
>Thanks.
For example:
LOCAL lcFile
lcFile = "c:\temp\mytestfile.xls"
PUBLIC oExcel
oExcel = CREATEOBJECT("Excel.Application")
oExcel.WorkBooks.OPEN(lcFile)
lnExcelRow = THISFORM.textbox1.VALUE
lnExcelCol = THISFORM.textbox2.VALUE
oExcel.Worksheets("Sheet1").ACTIVATE()
WITH oExcel.ActiveWorkbook.ActiveSheet
.Cells(lnExcelRow,lnExcelCol ).VALUE = somevalue
ENDWITH
oExcel.Worksheets("Sheet2").ACTIVATE()
HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison