>What version of Excel? I've found that with Excel 2000, since it spawns a new instance for each sheet, that GETOBJECT() isn't needed, but rather CREATEOBJECT(). Further, if this is a previous version, have you verified that an open instance of Excel exists?
thanks, It's E'97
here is the whole code:
gfile='c:\temp\inv2.xls'
oleApp = createobject("Excel.Application")
oExcel=oleApp.Application
oExcel.Workbooks.Add(gfile)
oleApp=getobject(,"Excel.Application")
for i = 1 to reccount('inv2')
lclocation = '"O'+alltrim(str(i+1))+'"'
Range(lclocation).Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
endfor
oleApp.Application.visible=.t.
If I comment out the entire for / endfor it opens the sheet as visible.
Thanks.
__Stephen