Roger,
Do you have any idea what this error message means, other than the excel export failed. Users get this all the time, but eventually after retrying and retrying, it eventually saves. Is it timing..ie, is the file not completely open and ready to save yet? I added delays but it did not appear to impact anything.
I know I can not save it and just leave it open for them, which would resolve it, but not be very efficient.
Here is that part of the code and the error on the save part. I use inkey, but know there are other ways to add delays.
keyin=inkey(2)
oBook := oExcel:workbooks:Open(filename)
keyin=inkey(2)
if !empty(newname)
oBook:SaveAs( newname , xlWorkbookNormal )
endif
oError:args :
-> VALTYPE: C VALUE: SaveAs
-> VALTYPE: C VALUE: \OISWIN\DOWNLOAD\BILL201108101412.XLS
-> VALTYPE: N VALUE: -4143
oError:description : SaveAs method of Workbook class failed
oError:filename : NIL
oError:genCode : NIL
oError:operation : SaveAs
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from AUTOMATIONOBJECT:ONERROR(1037) Called from ASCOMERROR:RAISE(308) Called from ASCOMERROR:RAISEERROR(505) Called from ASCOMERROR:RAISEONERROR(530) Called from AUTOMATIONOBJECT:NOMETHOD(957) Called from EXCEL1(74) Called from BILLDWN2(280) Called from (B)MAIN(0)
Fred
Omni
Excel error
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: Excel error
Is that right, that the drive letter is missing in newname ?
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: Excel error
The default drive letter varies, but OUR drive is showing on the error log as the current default drive, which is usually "O" or "G".
Re: Excel error
as i know you have to include "full" Path ( UNC or Driveletter )omni wrote:The default drive letter varies, but OUR drive is showing on the error log as the current default drive, which is usually "O" or "G".
greetings by OHR
Jimmy
Jimmy
Re: Excel error
I agree. I think the problem is the missing drive letter.
The eXpress train is coming - and it has more cars.
Re: Excel error
I just pasted in what I thought was relevant. This is part of the code for the file name just before what you see.
This is for the file being opened initially.
if substr(filename,2,1)<>":"
filename=curdrive()+":"+alltrim(filename)
endif
The file always opened right, but the save (the new filename) was the problem, which did not have that drive letter added. What you are saying sounds right and I made the change and will send to all the users. Not sure why we did one right and the other one wrong....
Thanks
Fred
This is for the file being opened initially.
if substr(filename,2,1)<>":"
filename=curdrive()+":"+alltrim(filename)
endif
The file always opened right, but the save (the new filename) was the problem, which did not have that drive letter added. What you are saying sounds right and I made the change and will send to all the users. Not sure why we did one right and the other one wrong....
Thanks
Fred