oMyXl.oleApp.Range(lcRangeString).Select1st, then it does not get a syntax error, but instead, fills the range with all values of '10001'
LOCAL lnRowCount, lnColumnCount, lcRangeString USE l:\boowned\surface\main0001 IN 0 ALIAS main SELECT wcode, tnum, tname, st, county, acct ; FROM main INTO cursor mysheet; WHERE class NOT like 'D__'; AND class NOT like 'N__' SELECT mysheet lnColumnCount = FCOUNT() lnRowCount = RECCOUNT() lcRangeString = 'A1'+':'+getletter(lnColumnCount)+ALLTRIM(STR(lnRowCount)) COPY TO ARRAY myarray DEBUG SUSPEND oMyXl = CREATEOBJECT("icgxl") oMyXl.Visible(.T.) oMyXl.CreateSheet(" ") oMyXl.oleApp.Worksheets("sheet1").Activate() *oMyXl.oleApp.Range(lcRangeString).Value = @myarray