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
CREATE (XlAPP, TRUE, TRUE) in RTC.
Any hint?
0
Answers
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
Software Development Engineer
Microsoft Dynamics NAV
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:
Variables:
Name DataType Subtype Length
XlApp Automation 'Microsoft Excel 12.0 Object Library'.Application
Code:
OnRun()
CREATE(XlApp,TRUE);
XlApp.Visible(TRUE);
XlApp.UserControl(TRUE);
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?
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
RIS Plus, LLC
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.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog