Page 1 of 1

Excel Save Problem

Posted: Wed Feb 01, 2012 8:53 am
by omni
Roger,

I have asked this on a prior log, but still having same problem.
We have export to excel with a save as, specific file name. Check for file existing, try to erase, and if failing, we assign a random file name. Users are still getting save errors constantly. We get logs from users daily on this. Test here and it works if we leave the file open and it assigns the random name.

Here is the snippet of code:


if file(newname)
if ferase(newname)=-1
else
//give it a temp file name
store 'XX'+STRZERO(round(dc_random(),0),3)+ STRZERO(round(dc_random(),0),3)+'.xls' to newname
endif
endif

if !empty(newname)
oBook:SaveAs( newname , xlWorkbookNormal )
endif


***end of code

Here is the error message. Always the same, except for the filename, which depends on which program/file/report is being exported.

oError:args :
-> VALTYPE: C VALUE: SaveAs
-> VALTYPE: C VALUE: Z:\oiswin\download\payrev.xls
-> VALTYPE: N VALUE: -4143
oError:description : Cannot access 'payrev.xls'.
oError:filename : NIL
oErro: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(89) Called from PRINTREADY(1013) Called from PRTPAYRV(440) Called from (B)MAIN(1318) WORKAREA STATUS:
***end of error log.

The path is fine. and the next time it works, or maybe the time after that( we may see 2 errors, but rarely more than that)

Any help is appreciated.

Fred
Omni

Re: Excel Save Problem

Posted: Wed Feb 01, 2012 3:00 pm
by Auge_Ohr
hi,

Question : what Client OS() ? what Server OS() ?
if Win 7 / Srv W2K8 try "SMB2" Patch
and the next time it works, or maybe the time after that(
use BEGIN SEQUENCE / RECOVER to catch those Errors.

i recommend "saveas" to local Harddisk and than copy to Server UNC Path.

Re: Excel Save Problem

Posted: Fri Feb 03, 2012 10:00 am
by rdonnay
I think that the file is being left open by Excel for some reason.

The next time this happens, click on Task Manager and see if Excel is still running as a process.
If so, then we need to determine why.