Hola :
alguien ha experimentado problemas con la funcion Ole2TxtError() con la nueva version de Harbour .
Tengo una aplicacion donde evaluo la instalacion de Excel y aunque este instalado la funcion no devuelve "S_OK" como antes .
Probe con Try Cath como alternativa pero en Harbour da error .
Hi:
someone has experienced problems with Ole2TxtError() function with the new version of Harbour.
I have an application where Excel will assess the installation and installed but this function does not return "S_OK" as before.
Try Probe with Cath as an alternative but fails in Harbour
Hmg 3.0
//////
oExcel := CreateObject("Excel.Application")
If Ole2TxtError() != "S_OK" <-- Error
MsgStop("Excel no esta disponible" )
Return nil
Endif
////////
Saludos
Mario Mansilla
Dbf To Excel ( Ole2TxtError() )
Moderator: Rathinagiri
-
Mario Mansilla
- Posts: 271
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
Re: Dbf To Excel ( Ole2TxtError() )
Maybe try to test returned value:
xAnswer := Ole2TxtError()
MsgBox("The type of answer is: " + valtype(xAnswer))
Maybe little sample?
(I'm using export to excel in my project, but I'm using BEGIN SEQUENCE... RECOVER
to catch errors)
xAnswer := Ole2TxtError()
MsgBox("The type of answer is: " + valtype(xAnswer))
Maybe little sample?
(I'm using export to excel in my project, but I'm using BEGIN SEQUENCE... RECOVER
to catch errors)
-
Mario Mansilla
- Posts: 271
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
Re: Dbf To Excel ( Ole2TxtError() )
Hola Mol
He probado lo que me propusiste y me devuelve un caracter nulo (nil) , ascii (cero) .
Tienes un ejemplo de uso de BEGIN SEQUENCE .. RECOVER para capturar errores .
Saludos .
Mario Mansilla
Hello Mol
I tried what I set out and returns me a null character (nil), ascii (zero).
You have an example of use of BEGIN SEQUENCE .. RECOVER to catch errors.
Greetings.
Mario Mansilla
He probado lo que me propusiste y me devuelve un caracter nulo (nil) , ascii (cero) .
Tienes un ejemplo de uso de BEGIN SEQUENCE .. RECOVER para capturar errores .
Saludos .
Mario Mansilla
Hello Mol
I tried what I set out and returns me a null character (nil), ascii (zero).
You have an example of use of BEGIN SEQUENCE .. RECOVER to catch errors.
Greetings.
Mario Mansilla
Re: Dbf To Excel ( Ole2TxtError() )
Code: Select all
XLSfile := "sample.xls"
OldErrorDriver := ErrorBlock({|e| break(e)})
BEGIN SEQUENCE
oExcel := CreateObject( "Excel.Application")
oExcel:Workbooks:Open(XLSfile, 2, .f., 1, "", "", .f.)
if oExcel:ActiveWorkBook:ReadOnly
MsgInfo("XLS file cannot be open in WRITE mode!")
lSheetOK := .f.
oExcel:Quit()
// remove excel from memory
oExcel := NIL
else
// I need to turn off autocalculation in Excel to speed writing to sheet
xlCalcStatus := oExcel:Calculation
oExcel:Calculation := xlManual
endif
RECOVER
MsgInfo("error while opening " + XLSfile)
lSheetOK := .f.
END
Re: Dbf To Excel ( Ole2TxtError() )
Remember to restore error handle after
Code: Select all
ErrorBlock(OldErrorDriver)
-
Mario Mansilla
- Posts: 271
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
Re: Dbf To Excel ( Ole2TxtError() )
Gracias Mol
Thanks Mol
Greetings.
Mario Mansilla
Thanks Mol
Greetings.
Mario Mansilla