Hola a todos:
He segudo tu consejo Antonio y he quitado el oleauto.prg de la compilacion y aunque al principio me daba aun un error:
Unresolved external '_HB_FUN_OLEUNINITIALIZE'
He visto en un post que añadiendo una funcion se solucionaba.
Yo esa clase la usaba para crear hojas excel y ahora cuando se estan creando me da el suguiente error
Code: Select all
Application
===========
Path and name: C:\ColtHop\cyewin\cyewin.exe (32 bits)
Size: 5,059,584 bytes
Time from start: 0 hours 0 mins 49 secs
Error occurred at: 05/08/2010, 09:48:41
Error description: Error 80071580/3 DISP_E_MEMBERNOTFOUND: END
Args:
Stack Calls
===========
Called from: source\rtl\win32ole.prg => TOLEAUTO:END(0)
Called from: gestempr.prg => LISTEMPR1(1037)
Called from: gestempr.prg => (b)LISTEMPR(866)
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176)
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1446)
Called from: .\source\classes\WINDOW.PRG => _FWH(3391)
Called from: => SENDMESSAGE(0)
Called from: .\source\classes\WINDOW.PRG => TMDICHILD:COMMAND(1035)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\MDICHILD.PRG => TMDICHILD:HANDLEEVENT(319)
Called from: .\source\classes\WINDOW.PRG => _FWH(3391)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(976)
Called from: cyewin.prg => MAIN(247)
El fuente es el siguiente :
Code: Select all
store Curdrive() to xdri
store GetCurdir() to xdir
store xdri + " :\" + xdir + "\emp" + zempr + "\" to direinic
fichsali:=cGetFile("*.xls",LocaText(227,7),,direinic,.F.,.T.)
if ! empty(fichsali)
if substr(fichsali,len(trim(fichsali))-3,4) <> ".xls"
fichsali = trim(fichsali) + ".xls"
endif
oExcel := TOleAuto():New( "Excel.Application" )
oWorkBook:=oExcel:WorkBooks:Add()
oHoja := oExcel:Get( "ActiveSheet" )
oHoja:Cells(1, 2):Font:Bold := .T.
oHoja:Cells(1, 2):Value := LocaText(227,2)
oHoja:Cells(3, 2):Value := LocaText(227,4) + " " + trim(va003) + " " + LocaText(227,6) + " " + trim(va004)
oHoja:Cells(4, 2):Value := LocaText(227,5) + " " + va001 + " " + LocaText(227,6) + " " + va002
oHoja:Cells(6, 1):Font:Bold := .T.
oHoja:Cells(6, 1):Value := LocaText(222,1)
oHoja:Cells(6, 2):Font:Bold := .T.
oHoja:Cells(6, 2):Value := LocaText(222,3)
oHoja:Cells(6, 3):Font:Bold := .T.
oHoja:Cells(6, 3):Value := LocaText(222,2)
oHoja:Cells(6, 4):Font:Bold := .T.
oHoja:Cells(6, 4):Value := LocaText(223,7)
oHoja:Cells(6, 5):Font:Bold := .T.
oHoja:Cells(6, 5):Value := LocaText(223,5)
oHoja:Cells(6, 6):Font:Bold := .T.
oHoja:Cells(6, 6):Value := LocaText(223,5)
oHoja:Cells(6, 7):Font:Bold := .T.
oHoja:Cells(6, 7):Value := LocaText(223,6)
oCol = 7
store space(1) to cuen
do while .T.
if eof()
exit
endif
oHoja:Cells(oCol, 1):Value := numero
oHoja:Cells(oCol, 2):Value := trim(apellidos)+ ", "+ nombre
oHoja:Cells(oCol, 3):Value := cif
oHoja:Cells(oCol, 4):Value := email
oHoja:Cells(oCol, 5):Value := Telefono
oHoja:Cells(oCol, 6):Value := Telefono2
oHoja:Cells(oCol, 7):Value := fax
skip + 1
oCol = oCol + 1
enddo
oHoja:Columns( 1):Autofit()
oHoja:Columns( 2):Autofit()
oHoja:Columns( 3):Autofit()
oHoja:Columns( 4):Autofit()
oHoja:Columns( 5):Autofit()
oHoja:Columns( 6):Autofit()
oHoja:Columns( 7):Autofit()
oHoja:End()
oWorkBook:SaveAs(fichsali)
oExcel:Quit()
oExcel:End()
oExcel:=NIL
OleUnInitialize()
ShellExecute(0,"Open",fichsali,NIL,NIL,1)
endif
y la línea 1037 es:
oHoja:End()
Alguien me podria orientar para poder solucionarlo, Gracias
Un saludo
Carlos