Error when opening Excel workbook in NAS

PieterFPieterF Member Posts: 3
NAV2009SP1 classic.
I've created a codeunit which opens an Excel file, do some things and closes the excel file.
This is running correcty, but not when I run this codeunit from a NAS.

Just to isolate the problem i've create a new codeunit with the following code in the OnRun trigger
T370.OpenBook('\\sharename\tmp\Test.xlsx','Sheet1');

If I run this codeunit from the objectdesigner everything works fine. No forms, exceldiaglogs or windows are opened.
I've attached this codeunit to the jobqueue and started the NAS.
In the Job Queue log entry I get the following error:

[The call to member Open failed. Microsoft Excel returned the following message:
Microsoft Excel cannot access the file '\\CNU0333Q5F\tmp\Test.xlsx'. There are several possible reasons:
• The file name or path does no•


Even more strangly is that, when I start the NAS from the commandprompt the Jobqueue is executed correctly.

I'm sure that this has nothing to with userright etc. because everyting is executed with administrator rights.

The suggestions in viewtopic.php?f=23&t=38483&start=0 and viewtopic.php?f=23&t=26971&hilit=excel+NAS&start=15 does not solve the problem

Does someone has a clue how to solve this?

Answers

  • ara3nara3n Member Posts: 9,256
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • KarenhKarenh Member Posts: 209
    I experienced this problem. It seems that when a file is created and save that the directory contents are not refreshed, so NAS cannot find the file.

    What I did to overcome this problem is to create pairs of codeunits. The first of the pair creates the file. The second emails it. The 2nd of the pair can find the file.
  • PieterFPieterF Member Posts: 3
    edited 2011-03-30
    Creating a desktop folder in the window system folder did solve the problem.

    Thanx for your help!
  • ara3nara3n Member Posts: 9,256
    you are welcome.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jenstoftjenstoft Member Posts: 5
    edited 2017-04-03
    I just ran into the issue described in this thread, but the link to the solution doesn't work anymore. Does anyone have the solution 'offline' somehow.
  • jenstoftjenstoft Member Posts: 5
    Found the answer to my own question.

    add folder:

    C:\Windows\SysWOW64\config\systemprofile\Desktop (if 64 bit)
    C:\Windows\System32\config\systemprofile\Desktop (if 32 bit)

    and work on the excel file from here
Sign In or Register to comment.