Is Excel automation supposed to work together with the NAS?

Miklos_HollenderMiklos_Hollender Member Posts: 1,598
I have heard somewhere that Office wasn't exactly designed for GUIless mode and does not support it fully. I have inserted the necessary IF GUIALLOWED THENs into the Excel Buffer and tried to use it through the NAS (i.e. generate reports through the night), but failed. Once it was "This message is for C/AL programmers: The call to member LeftHeader failed. Microsoft Office Excel returned the following message:Unable to set the LeftHeader property of the PageSetup class " for a report that works perfectly through the GUI. Another time it was simply that the Job Queue Entry stayed hanging ("in process") forever. This doesn't look very stable.

Should I experiment with it more? Is it supposed to work?

If not then I could still write an Excel XML but that looks very, very completed AFAIK. Is there an easy way to do that other than external components?

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    This is the answer (a part of it) that I received from Microsoft support, when I had a similar issue:
    Also, from the Office teams we got this long set of recommendations basically saying that Office applications cannot be guaranteed to work the same way when started from a service:
    http://support.microsoft.com/default.as ... -us;257757

    The suggestion in this article is to use Office XML instead of Automation, but I think that this would require major work.

    An alternative would be, and you probably tried that already, to run NAS from the command prompt.
    You could try the suggestion to start NAS from a command shell. That is a similar approach used in Job Queue for Unlimited Company
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • kinekine Member Posts: 12,562
    THe "job queue hanging" symptom is in most cases caused by cyclical CREATE of some automation. The NAV is not cleaning the automation correctly and thus if you instantiate automation too many times, NAS will "hang"... you can try to use singleinstance codeunit to instantiate the automation only once if possible.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.