tipo de dato indefinido al leer planilla EXCEL

tipo de dato indefinido al leer planilla EXCEL

Postby lafug » Mon Apr 21, 2014 4:37 pm

Estimados,

Estoy leyendo una planilla Excel desde FiveWin y el programa no reconoce si el campo es numérico o alfanumérico, por lo que no puedo capturar la información.
Ya le dí los respectivos formatos a los campos dentro de la planilla Excel y aún asi los sigue leyendo como tipo "U" undefine.
Aqui está el codigo fuente
desde ya agradezco cualquier ayuda
saludos!

FUNCTION LEEEXCEL()
LOCAL cFile,oExcel,oBook,oHoja,nTotRowCount,cNombre,nTotal,Q

cFile :="C:\VENTAS.xlsx"
oExcel:=TOleAuto():New("Excel.Application")
oBook := oExcel:Workbooks:Open(cFile)
oHoja := oExcel:Get( "ActiveSheet" )

nTotRowCount:= oHoja:UsedRange:Rows:Count()

USE C:\VENTAS NEW EXCLUSIVE

FOR Q=2 TO nTotRowCount

cNombre:=oHoja:Cells( Q, 1 ):Value
nTotal:=oHoja:Cells( Q, 3 ):Value

? TYPE("cNombre")
MsgInfo(cNombre)

//VENTAS->(DBAPPEND())
//VENTAS->CAMPO1:= vColumna1

NEXT
VENTAS->(DBCLOSEAREA())
oExcel:WorkBooks:Close()
oExcel:Application:Quit()
RELEASE oHoja
RELEASE oExcel
RETURN .T.
Luis Alfonso Fuentes Guerrero
FWH 11.06 xHarbour 1.2.1 BCC55 WorkShop
User avatar
lafug
 
Posts: 185
Joined: Thu Nov 17, 2005 12:48 am
Location: Santiago, Chile

Re: tipo de dato indefinido al leer planilla EXCEL

Postby Vikthor.Thomas » Mon May 05, 2014 3:35 pm

Hola

Me paso algo similar, lo solucioné haciendo una copia de las hoja y pegando los datos "Sin formato", sólo utilizando valores.


Saludos
User avatar
Vikthor.Thomas
 
Posts: 144
Joined: Thu Jan 02, 2014 1:49 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests