>>LOCAL loExcel AS Excel.APPLICATION >> >>loExcel = CREATEOBJECT("Excel.application") >>loExcel.VISIBLE = .F. >> >>loWorkBook = loExcel.Workbooks.OPEN('P:\Flock Information.xls') >>loExcel.displayalerts = .F. >> >>loWorkBook.Sheets("28 Day").SELECT >> >>FOR i = 288 TO 300 >> legRow = 'M' + ALLTRIM(STR(i)) >> loWorkBook.ActiveSheet.RANGE("&legRow").select >> loExcel.ActiveCell.Value = ALLTRIM(STR(i)) &&<--- This doesn't work >>*!* loWorkBook.ActiveSheet.RANGE("&legRow").Value = ALLTRIM(STR(i)) &&<---- This doesn't work either >>NEXT >> >> >>* Hardcoding the range also does not work >>loWorkBook.ActiveSheet.RANGE("M288").select >>loExcel.ActiveCell.Value = "Hello" >> >>* Execute this code just to make sure there is a connection, and IT WORKS >>lcTest = loWorkBook.ActiveSheet.RANGE("L288").VALUE >>? lcTest >> >>loExcel.displayalerts = .F. >>loExcel.QUIT() >>RELEASE loExcel >>loExcel = NULL >>>
>loWorkbook.Sheets("28 Day").Cell(m.i, m.j).Value = ALLTRIM(STR(i)) >>
lcSheet = "28 Day" lcSheet = "Sheet1" lnColumn = 14 FOR i = 288 TO 300 *legRow = 'M' + ALLTRIM(STR(i)) loWorkbook.Sheets(lcSheet).Cell(i, lnColumn).Value = ALLTRIM(STR(i)) *loWorkBook.ActiveSheet.RANGE("&legRow").select *loExcel.ActiveCell.Value = ALLTRIM(STR(i)) &&<--- This doesn't work *!* loWorkBook.ActiveSheet.RANGE("&legRow").Value = ALLTRIM(STR(i)) &&<---- This doesn't work either NEXTMy question is (rather than you spoonfeeding me the solution), whats the best way to get the right syntax, using your line of code as an example? I tried with intellisense, but got lost.
ActiveCell.Offset(0, -2).Value)Yossi