Export excel through NAS in NAV 2013 R2

snupy
Member Posts: 11
Please help!
I want to upload the data to a file excel template through NAS, but an error in XlHelper.CallOpen(XlAppRTC,FileName). (all dotnet RunOnClient = no)
Message: Cannot create an instance of the following .NET Framework: сборка Microsoft.Dynamics.Nav.Integration.Office, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, тип Microsoft.Dynamics.Nav.Integration.Office.Excel.ExcelHelper.
Type: System.IO.FileNotFoundException
Message: Could not load file or assembly 'Microsoft.Dynamics.Nav.Integration.Office, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
FileName: Microsoft.Dynamics.Nav.Integration.Office, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog:
c al code
IF FileName = '' THEN
ERROR(EmptyFileNameErr);
XlAppRTC := XlAppRTC.ApplicationClass;
IF ISNULL(XlAppRTC) THEN
ERROR(ExcelNotFoundErr);
XlHelper.CallOpen(XlAppRTC,FileName);
XlWrkBkRTC := XlAppRTC.ActiveWorkbook;
What could be the reason?
I want to upload the data to a file excel template through NAS, but an error in XlHelper.CallOpen(XlAppRTC,FileName). (all dotnet RunOnClient = no)
Message: Cannot create an instance of the following .NET Framework: сборка Microsoft.Dynamics.Nav.Integration.Office, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, тип Microsoft.Dynamics.Nav.Integration.Office.Excel.ExcelHelper.
Type: System.IO.FileNotFoundException
Message: Could not load file or assembly 'Microsoft.Dynamics.Nav.Integration.Office, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
FileName: Microsoft.Dynamics.Nav.Integration.Office, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog:
c al code
IF FileName = '' THEN
ERROR(EmptyFileNameErr);
XlAppRTC := XlAppRTC.ApplicationClass;
IF ISNULL(XlAppRTC) THEN
ERROR(ExcelNotFoundErr);
XlHelper.CallOpen(XlAppRTC,FileName);
XlWrkBkRTC := XlAppRTC.ActiveWorkbook;
What could be the reason?
0
Best Answer
-
Are you sure that the Microsoft.Dynamics.NAV.Integration.Office.DLL has been installed correctly on the server?
This should be under C:\Program Files\Microsoft Dynamics NAV\xx\Service\Add-ins\Office if the install was does to the default folders.5
Answers
-
it seems system is not able to find the file.
please check with EXIST function before whether file is existing or not.0 -
Hmohana_cse06 wrote: »it seems system is not able to find the file.
please check with EXIST function before whether file is existing or not.
Hello,
I wrote this
IF FileName = '' THEN
ERROR(EmptyFileNameErr);
XlAppRTC := XlAppRTC.ApplicationClass;
IF ISNULL(XlAppRTC) THEN
ERROR(ExcelNotFoundErr);
IF NOT EXISTS(FileName) THEN
ERROR(ExcelNotFoundErr);
XlHelper.CallOpen(XlAppRTC,FileName);
XlWrkBkRTC := XlAppRTC.ActiveWorkbook;
error persists
0 -
Help!
0 -
have you seen this blog post by Saurav?...
Microsoft Dynamics NAV 2016 - Save Export To Excel With NAS!
...I know it says 2016 but you should be able to use/tweak it for 2013 R20 -
If you are going to run all of the DotNet on the Service Tier, then Excel has to be installed on the service tier. I'd say switch the DotNet controls to run on the client and see if that fixes your problem.
EXIST will only run on the NST system.Kyle Hardin - ArcherPoint0 -
have you seen this blog post by Saurav?...
Microsoft Dynamics NAV 2016 - Save Export To Excel With NAS!
...I know it says 2016 but you should be able to use/tweak it for 2013 R2
Hello Kishorm,
I have another case. I need to Export the data in the template Excel. This template is written macro.
FileName := 'C:\log\1\Template File Name';
ExcelBuf.OpenBook_NAS2(FileName);
ExcelBuf.OpenSheet_NAS2("Template Sheet Name");
ExcelBuf.CreateSheetNoFormat_NAS2("Template Sheet Name");
ExcelBuf.GiveUserControlNASRTC3;
OpenBook_NAS2(FileName : Text[250])
IF FileName = '' THEN
ERROR(EmptyFileNameErr);
XlAppRTC := XlAppRTC.ApplicationClass;
IF ISNULL(XlAppRTC) THEN
ERROR(ExcelNotFoundErr);
IF NOT EXISTS(FileName) THEN
ERROR(ExcelNotFoundErr);
// Here is the error
XlHelper.CallOpen(XlAppRTC,FileName);
//
XlWrkBkRTC := XlAppRTC.ActiveWorkbook;
0 -
kylehardin wrote: »If you are going to run all of the DotNet on the Service Tier, then Excel has to be installed on the service tier. I'd say switch the DotNet controls to run on the client and see if that fixes your problem.
EXIST will only run on the NST system.
Hello,
Exell (office 16) installed on Server Navision and on Client. IF DotNet = yes and running on clent, it work very good.0 -
Are you sure that the Microsoft.Dynamics.NAV.Integration.Office.DLL has been installed correctly on the server?
This should be under C:\Program Files\Microsoft Dynamics NAV\xx\Service\Add-ins\Office if the install was does to the default folders.5 -
Are you sure that the Microsoft.Dynamics.NAV.Integration.Office.DLL has been installed correctly on the server?
This should be under C:\Program Files\Microsoft Dynamics NAV\xx\Service\Add-ins\Office if the install was does to the default folders.
Kishorm, you are a genius
Folder Office was C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client\Add-ins\Office. I moved C:\Program Files\Microsoft Dynamics NAV\xx\Service\Add-ins\Office and it's worked!
Thank you0 -
Are you sure that the Microsoft.Dynamics.NAV.Integration.Office.DLL has been installed correctly on the server?
This should be under C:\Program Files\Microsoft Dynamics NAV\xx\Service\Add-ins\Office if the install was does to the default folders.
Hi Everyone,
Can you please!
What am I doing wrong?
Now, an error in the function ExcelBuf.OpenSheet_NAS2("Template Sheet Name");
OpenSheet_NAS2(SheetName : Text[30])
i := 1;
EndOfLoop := XlWrkBkRTC.Worksheets.Count;
ERROR
A call to System.__ComObject.get_Count failed with this message: The type of one or more arguments does not match the method's parameter type.
WHILE (i <= EndOfLoop) AND (NOT Found) DO BEGIN
XlWrkShtRTC := XlWrkBkRTC.Worksheets.Item(i);
ERROR
A call to System.__ComObject.get_Item failed with this message: The type of one or more arguments does not match the method's parameter type.
IF SheetName = XlWrkShtRTC.Name THEN
Found := TRUE;
i := i + 1;
END;
IF Found THEN
XlWrkShtRTC := XlWrkBkRTC.Worksheets.Item(SheetName)
ELSE
ErrorExcelProcessing(STRSUBSTNO(WorksheetNotFoundErr,SheetName));
Help me, please!!!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions