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?
0
Answers
please check with EXIST function before whether file is existing or not.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
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
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
EXIST will only run on the NST system.
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;
Hello,
Exell (office 16) installed on Server Navision and on Client. IF DotNet = yes and running on clent, it work very good.
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 you
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!!!