Problem to save excel file with NAS

Lorentz_Lorentz_ Member Posts: 3
Hello

I get the error to save the file with excel automation using the NAS.
This message is for C/AL programmers:

The call to member SaveAs failed. Microsoft Office Excel returned the following message:
Errore nel metodo SaveAs per la classe Workbook.
(Error in the Workbook SaveAs method to the class)

No errors occurred with manually run using the same user.

To open and fill the file I'm using the standard functions in the Excel Buffer table.

To save the file I added this:

XlWrkBk.SaveAs(PathFileName);
XlWrkBk.Close(FALSE);
XlApp.Quit;
CLEAR(XlApp);

Thank's for the help!
Lorenzo

Comments

  • vaprogvaprog Member Posts: 1,141
    Lorentz_ wrote:
    No errors occurred with manually run using the same user.
    Which user? The NAS Service account user?

    Did you try to save to the same location as NAS tries to save to?
  • KishormKishorm Member Posts: 921
    I think this is the problem with the Desktop folder that needs to be created, please see the following post for more details...

    viewtopic.php?t=41423
  • Lorentz_Lorentz_ Member Posts: 3
    the problem was the desktop folder...
    Thanks a lot!
  • vaprogvaprog Member Posts: 1,141
    Lorentz_ wrote:
    No errors occurred with manually run using the same user.

    How did you do that, not having a desktop folder for the user?
  • KishormKishorm Member Posts: 921
    vaprog wrote:
    Lorentz_ wrote:
    No errors occurred with manually run using the same user.

    How did you do that, not having a desktop folder for the user?

    It's not a desktop folder for the user but something to do with the "windows stations" - if you follow the link within the link I mentioned earlier you can read more about it.
  • vaprogvaprog Member Posts: 1,141
    Kishorm wrote:
    It's not a desktop folder for the user but something to do with the "windows stations" - if you follow the link within the link I mentioned earlier you can read more about it.
    From what I read there (that is in the thread ara3n links to), I could not help but assume Excel was run in the context of the services user (local system) which really is to be expected. The talk there about stations I could not understand and there seems to be some mix-up with sessions (In Process Explorer stations have names like \Sessions\2\Windows\WindowStations\WinSta0 or \Windows\WindowStations\Service-0x0-3e7$ not 0 or 1 as mentioned in that thread). When I followed links mentioned there, I learned the issue is related to 32/64-bit transition issues.

    I should have noted before that the issue can not be related to the NAS service account, since NAS needs to be able to logon to NAV as windows user and thus cannot use the local system account.

    Anyway, according to http://support.microsoft.com/kb/257757/EN-US (Considerations for server-side Automation of Office) the NAS service account needs to have a desktop folder too.
Sign In or Register to comment.