Filexls
Posted: Tue May 22, 2007 1:54 pm
Amigos:
Trato de pasar de una hoja de excel a dbf y
obtengo este error... alguna idea
Harbour, FWH7.05, Borland
Muchas gracias.
Ruben Fernandez.
Este es el código y debajo ele rror.
oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cFilePath(GetModuleFileName(GetInstance()))+"eventos.xls")
oHoja := oExcel:Get( "ActiveSheet" )
nRows := oHoja:UsedRange:Rows:Count()
nCols := oHoja:UsedRange:Columns:Count()
FOR nCol := 1 TO nCols
IF ValType( oHoja:Cells( 2, nCol ):Value ) = "C"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "C", 25, 0 } )
ELSEIF ValType( oHoja:Cells( 2, nCol ):Value ) = "N"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "N", 6, 0 } )
ELSEIF ValType( oHoja:Cells( 2, nCol ):Value ) = "L"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "L", 1, 0 } )
ELSEIF ValType( oHoja:Cells( 2, nCol ):Value ) = "D"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "D", 8, 0 } )
ENDIF
NEXT
Aqui comienza el error.
Error Excel.Application/16389 E_FAIL: ACTIVESHEET
Argumentos :
[ 1] = U
Llamadas al Stack
________________________________________________________________________________
Called from TOLEAUTO:ACTIVESHEET(0)
Called from HB_EXECFROMARRAY(0)
Called from TOLEAUTO:GET(349)
Called from READEXEL(859)
Called from (b)LEEREVENTO(829)
Called from (b)MSGRUN(0)
Called from (b)TDIALOG(0)
Called from TDIALOG:DISPLAY(0)
Called from TDIALOG:HANDLEEVENT(0)
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(0)
Trato de pasar de una hoja de excel a dbf y
obtengo este error... alguna idea
Harbour, FWH7.05, Borland
Muchas gracias.
Ruben Fernandez.
Este es el código y debajo ele rror.
oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cFilePath(GetModuleFileName(GetInstance()))+"eventos.xls")
oHoja := oExcel:Get( "ActiveSheet" )
nRows := oHoja:UsedRange:Rows:Count()
nCols := oHoja:UsedRange:Columns:Count()
FOR nCol := 1 TO nCols
IF ValType( oHoja:Cells( 2, nCol ):Value ) = "C"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "C", 25, 0 } )
ELSEIF ValType( oHoja:Cells( 2, nCol ):Value ) = "N"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "N", 6, 0 } )
ELSEIF ValType( oHoja:Cells( 2, nCol ):Value ) = "L"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "L", 1, 0 } )
ELSEIF ValType( oHoja:Cells( 2, nCol ):Value ) = "D"
AADD( aCampos, { oHoja:Cells( 1, nCol ):Value, "D", 8, 0 } )
ENDIF
NEXT
Aqui comienza el error.
Error Excel.Application/16389 E_FAIL: ACTIVESHEET
Argumentos :
[ 1] = U
Llamadas al Stack
________________________________________________________________________________
Called from TOLEAUTO:ACTIVESHEET(0)
Called from HB_EXECFROMARRAY(0)
Called from TOLEAUTO:GET(349)
Called from READEXEL(859)
Called from (b)LEEREVENTO(829)
Called from (b)MSGRUN(0)
Called from (b)TDIALOG(0)
Called from TDIALOG:DISPLAY(0)
Called from TDIALOG:HANDLEEVENT(0)
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(0)