Saludos, alguno de ustedes me puede ayudar con esto, el codigo funciona perfecto, leo la hoja Excel sin problemas, pero al finalizar en la linea oExcel:Quit() bota error, si lo comento me bora error en oHoja:End(), alguien sabe como solucionarlo, adjunto programa.
///// Programa ///////
LOCAL oExcel, oHoja, nRows, nCols
oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cGetFile("*.XLS", "Seleccione Archivo"))
oHoja := oExcel:Get( "ActiveSheet" )
nRows := oHoja:UsedRange:Rows:Count()
nCols := oHoja:UsedRange:Columns:Count()
FOR nRow := 2 TO nRows
FOR nCol := 1 TO nCols
? oHoja:Cells(nRow, nCol):Value
SysRefresh()
NEXT
NEXT
oExcel:Quit()
oHoja:End()
oExcel:End()
////// Error.Log ///////
Application
===========
Path and name: D:\Contfive\contsqlx.exe (32 bits)
Size: 1,888,256 bytes
Time from start: 0 hours 0 mins 13 secs
Error occurred at: 07/05/2008, 09:17:49
Error description: Error Excel.Application:ACTIVESHEET/16389 E_FAIL: END
Args:
Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:END(0)
Called from: conting1.prg => IMPBCI(3398)
Called from: contfive.prg => (b)BUILDMENU(6744)
Called from: MENU.PRG => TMENU:COMMAND(0)
Called from: WINDOW.PRG => TWINDOW:COMMAND(0)
Called from: MDIFRAME.PRG => TMDIFRAME:COMMAND(0)
Called from: WINDOW.PRG => TMDIFRAME:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: contfive.prg => MAIN(2435)
Gracias