ayuda con Excel

ayuda con Excel

Postby un_jeepero » Mon Mar 30, 2009 9:20 pm

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....
un_jeepero
 
Posts: 31
Joined: Fri Mar 17, 2006 2:04 pm

Re: ayuda con Excel

Postby sysctrl2 » Mon Mar 30, 2009 9:46 pm

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 )
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 981
Joined: Mon Feb 05, 2007 7:15 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 131 guests