Options

NAS Job Queue and create excel-file

tinoruijstinoruijs Member Posts: 1,226
Hi,

I have a codeunit that creates a Excel-document. This works fine.
I want to schedule this codeunit to run each day one time.
So I have a NAS for JOBQUEUE which also works fine, because other codeunit are executed well.
The problem with the excel-document is an error: Cannot find Excel.
Although Excel is installed on the server where the NAS is installed...

Can a NAS create a Excel-document?

Tino Ruijs
Microsoft Dynamics NAV specialist

Answers

  • Options
    WaldoWaldo Member Posts: 3,412
    Yes, it can, but you have to be aware that it can't "show" any forms. So make sure you're creating excel without showing it. There should be an option for it.

    Something like "XlApp.Visible(FALSE)"

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Waldo wrote:
    Yes, it can, but you have to be aware that it can't "show" any forms. So make sure you're creating excel without showing it. There should be an option for it.

    Something like "XlApp.Visible(FALSE)"

    That's the correct option indeed for not showing Excel. But I already used that.
    Perhaps the problem is there's no Excel installed on the server on which NAV is installed? :-k
    Excel is installed on the server on which the NAS is working. I thought that would do the trick..

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    WaldoWaldo Member Posts: 3,412
    :-k
    That should do the trick, yes.

    I'm comparing with one of our installations, where we don't creates an excel, but we use excel automation (open excel, fill in parameters, read results) in a NAS.

    Works without any problems...

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Waldo wrote:
    :-k
    That should do the trick, yes.

    I'm comparing with one of our installations, where we don't creates an excel, but we use excel automation (open excel, fill in parameters, read results) in a NAS.

    Works without any problems...

    Ok. Strange.
    When I use a normal NAV client on the server where the NAS is installed, the codeunit which calls the reports is executed fine..

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    WaldoWaldo Member Posts: 3,412
    And no popup form or whatever?

    Can you test by installing a nas on that client?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Waldo wrote:
    And no popup form or whatever?

    Can you test by installing a nas on that client?

    Only a dialog-box, but I covered that by using "If GUIALLOWED".

    On that client/server the NAS is installed.

    On server1 the sql-server is installed.
    On server2 the NAS, a NAV-client and Excel are installed.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    WaldoWaldo Member Posts: 3,412
    Seems like a correct setup to me.

    Did you try NAS in debug-mode?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Waldo wrote:
    Seems like a correct setup to me.

    Did you try NAS in debug-mode?

    Not yet.
    I guess the problem could be the excel-version. Although that's 2003. Should be fine.
    I'm using table 370 to generate the excel-file. When I open the globals the automations all are "Unknown Automation Server". I guess the table should be compiled with the automation available on the server where the NAS is installed.
    I let you know if that is the fix.

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    tinoruijs wrote:
    Waldo wrote:
    Seems like a correct setup to me.

    Did you try NAS in debug-mode?

    Not yet.
    I guess the problem could be the excel-version. Although that's 2003. Should be fine.
    I'm using table 370 to generate the excel-file. When I open the globals the automations all are "Unknown Automation Server". I guess the table should be compiled with the automation available on the server where the NAS is installed.
    I let you know if that is the fix.

    :( Compiling the table with the right automations didn't change a thing.
    And installing Excel on server1 neither. :(

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    WaldoWaldo Member Posts: 3,412
    And debugging?
    On which line does it give you the error?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    garakgarak Member Posts: 3,263
    do you have restart the NAS after changing the code :?:
    Is the right Excel version on the NAS-computer ?
    Do you has start the NAS in debugmode?
    Do you make it right, it works too!
  • Options
    WaldoWaldo Member Posts: 3,412
    garak wrote:
    Do you has start the NAS in debugmode?

    Hey, that's a good idea! :mrgreen:

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    garakgarak Member Posts: 3,263
    I know :whistle:
    Do you make it right, it works too!
  • Options
    ajhvdbajhvdb Member Posts: 672
    Also login on the server as the NAS user (defined in the service), install a printer, start excel and set the correct reginal settings. This all will be saved in the windows profile.
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Thank you all for the reactions!
    I've tried a lot of things but no succes yet..

    I'm going to try it again after my vacation. :mrgreen:

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    garakgarak Member Posts: 3,263
    enjoy it :D
    Do you make it right, it works too!
  • Options
    WaldoWaldo Member Posts: 3,412
    Have a good holiday, Tino!

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    tinoruijstinoruijs Member Posts: 1,226
    Waldo wrote:
    Have a good holiday, Tino!

    Thanks Eric!
    It was a good holiday. :)

    I finally got it to work.
    The last thing I changed was a driveletter in a path to an UNC-path.
    Now it works! :)

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • Options
    greensmilegreensmile Member Posts: 7
    tinoruijs wrote:
    The last thing I changed was a driveletter in a path to an UNC-path.
    Now it works! :)

    Hi,
    can you explain me, how did you solve this problem? I have same issue too. If I run NAS as console application and export to Excel, works fine. When it is running as service, error "Aplikace Excel nebyla nalezena" (enu="Cannot find Excel.") is raised in event log. Same machine, same user, same rights... :-k
    _-========-_
    GreenSmile
  • Options
    greensmilegreensmile Member Posts: 7
    greensmile wrote:
    tinoruijs wrote:
    The last thing I changed was a driveletter in a path to an UNC-path.
    Now it works! :)

    Hi,
    can you explain me, how did you solve this problem? I have same issue too. If I run NAS as console application and export to Excel, works fine. When it is running as service, error "Aplikace Excel nebyla nalezena" (enu="Cannot find Excel.") is raised in event log. Same machine, same user, same rights... :-k

    HEUREKA. You can't create Excel.Application instance without administrator rights when NAS run as service. After assigning admin rights, export to Excel done. My goodness ... ](*,)
    _-========-_
    GreenSmile
Sign In or Register to comment.