Page 1 of 1

ayuda con Excel

Posted: Mon Mar 30, 2009 9:20 pm
by un_jeepero
amigos

ayuda por favor....

abro un planilla excel para cargar sus datos en una dbf al abrirla y leer sus datos no tengo problema, pero si cancelo la apertura aparece este error y me bota el exe.

Error occurred at: 30/03/2009, 17:00:25
Error description: Error Excel.Application:WORKBOOKS/16389 E_FAIL: OPEN
Args:
[ 1] = C

Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:OPEN(0)
Called from: FT201b.prg => T201B:IMPORTAR_DATOS(288)
Called from: FT201b.prg => (b)T201B:NEW(190)
Called from: BTNBMP.PRG => TBTNBMP:CLICK(0)
Called from: BTNBMP.PRG => TBTNBMP:LBUTTONUP(0)
Called from: WINDOW.PRG => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TBTNBMP:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: FT.prg => TAPP:NEW(307)
Called from: FT.prg => MAIN(114)

este el código de apertura y funciona perfecto

Local oExcel, oHoja, nRow, nCols, aFor, bFor, nAt, aDatos := Array(03)

oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cGetFile("*.XLS", "Seleccione Fichero"))
oHoja := oExcel:Get( "ActiveSheet" )

nRows := oHoja:UsedRange:Rows:Count()
nCols := oHoja:UsedRange:Columns:Count()
FOR aFor = 1 to nRows
For bFor =1 to nCols
nAt := Len( aDatos )
xValue := oHoja:Cells(aFor,bFor):Value
aDatos[nAt][bFor] := xValue
SysRefresh()
NEXT
Memory(-1)
NEXT
oExcel:Quit()

....
...

Alguna ayuda....

Re: ayuda con Excel

Posted: Mon Mar 30, 2009 9:46 pm
by sysctrl2
creo que hay que ayudarle un poquito a la apertura..


cFile := cGetFile("*.XLS", "Seleccione Fichero")
if empty( cFile)
retur nil
endif

oExcel:WorkBooks:Open( cFile )