Page 1 of 1

Excel error

Posted: Tue Aug 16, 2011 2:37 pm
by omni
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

Re: Excel error

Posted: Tue Aug 16, 2011 10:29 pm
by Wolfgang Ciriack
Is that right, that the drive letter is missing in newname ?

Re: Excel error

Posted: Wed Aug 17, 2011 8:55 am
by omni
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

Posted: Wed Aug 17, 2011 10:49 am
by Auge_Ohr
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".
as i know you have to include "full" Path ( UNC or Driveletter )

Re: Excel error

Posted: Thu Aug 18, 2011 10:02 am
by rdonnay
I agree. I think the problem is the missing drive letter.

Re: Excel error

Posted: Fri Aug 19, 2011 1:35 pm
by omni
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