Excel in NAV 2009 RTC (Budget - Export to Excel)

TronholmTronholm Member Posts: 22
edited 2008-12-18 in NAV Three Tier
In NAV 5.0 you have Export to Excel / Import from Excel for example in 'General Ledger - Budget - Functions'. This is not present in NAV 2009. This functionality is based on Table 370 Excel Buffer, which uses variables of type Automation to CREATE and use an instance of EXCEL.
Now I use 370 Excel Buffer extensively for reporting. It still works in NAV 2009 Classic Client, buy I can't get it working in NAV 2009 RTC. The NAV Server is running on the same PC as the client (my desktop, actually). I get an error when I try
Any hint?


  • PKirkbyPKirkby Member Posts: 1
    Try to delete your personalization data - If you answered Never Allow to run Excel, that will automatically prevent any future use on your client.

    del "%appdata%\Microsoft\Microsoft Dynamics NAV\PersonalizationStore.xml"

    If you still have the problem - try attaching a debugger and break on errors, this often gives you a better idea of what is happening. There is a guide on debugging on http://blogs.msdn.com/clausl/archive/2008/10/14/debugging-in-nav-2009.aspx

    PS: A little tip to debuggin is to create the breakpoint manually. In VS go Debugging -> New BreakPoint -> Break af Function -> Record370.CreateBook, and you will break straight into the CreateBook method on table 370.

    Phillip Kirkby
    Software Development Engineer
    Microsoft Dynamics NAV
  • TronholmTronholm Member Posts: 22
    Thanks. Deleting "%appdata%\Microsoft\Microsoft Dynamics NAV\PersonalizationStore.xml" actually made the thing work ONCE! in RTC.

    I think there might be some bug in RTC preventing the COM to work. This is a the very simple codeunit that just opens Excel in a window. It works fine in Classic, and worked just once in RTC:

    Name DataType Subtype Length
    XlApp Automation 'Microsoft Excel 12.0 Object Library'.Application


    In RTC, this error appears when executing CREATE:
    This message is for C/AL programmers: Unable to create an instance of Automation Server Microsoft.Office.Interop.Excel.ApplicationClass with CLSID = 00024500-0000-0000-C000-000000000046 Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005..

    I've tried with other Automation Servers with same results (works ok in Classic, error in RTC).

    Have anybody actually tried this out in RTC?
  • DenSterDenSter Member Posts: 8,277
    CREATE has a new optional third parameter called 'ClientSide' which determines if the automation variable is instantiated on the service tier or on the client computer. I would try setting that to TRUE, which I would expect to create the instance of the Excel app on the client side.

    I don't know if that'll work though, I have not tried that yet. I have a feeling that I will have to very soon due to a project I am working on, but for now I'll let you take a shot at it :mrgreen:
  • TronholmTronholm Member Posts: 22
    Thanks! This actually works. Three learnings from this:
    1) When using automation from NAV 2009 RTC, you must take care of "%appdata%\Microsoft\Microsoft Dynamics NAV\PersonalizationStore.xml" and eventually delete this file if some user has not answered correctly when asked to allow or not execution of the instanciated application.
    2) There is a third (undocumented?) parameter in the CREATE function to tell RTC to instanciate on the client side: CREATE(XlAPP,TRUE,TRUE). You have to fix code in table 370 Excel Buffer if you want to use it on RTC.
    3) Somo functionality is not available or tested yes in NAV 2009 Role Tailored Client.
  • BeliasBelias Member Posts: 2,996
    2) I read about this parameter somewere in official documentation...but I don't remember which one :oops:
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.