Hey everyone,
I just moved the NAS from one machine to another - installed the same version of Excel 2007. Running on Server 2008 NAV 5.0 SP1.
Before I ran updates, I tried having the NAS Fire off some of the jobs I had setup and been using for quite some time now. In them I am using Excel Buffer to make an excel file and then call my own Function in ExcelBuffer where I pass the Filename and save type.
XlWrkBk.SaveAs(FileName,iTypeCode);
XlWrkBk.Close();
XlApp.Quit();
iTypeCode = 56 for Excel 2003 file.
I attempted removing this since it was optional - saving it as 2007, and even tried the SaveAsCopy method.
For some reason now, this is the part that isn't making sense to me, When I run the codeunit manually (EDIT: From this server using NAV Cleint) - it works. When the NAS Runs it, I get this in the Job Queue Log Entries:
This message is for C/AL programmers:
The call to member SaveAs failed. Microsoft Office Excel returned the following message:
SaveAs method of Workbook class failed
The NAS Login has permission to everywhere it is writing - there is nothing in the Event Viewer except Microsoft Office Sessions Warning just saying:
ID: 1, Application Name: Microsoft Office Excel, Application Version: 12.0.6524.5003, Microsoft Office Version: 12.0.6425.1000. This session was terminated unexpectedly.
I installed updates, still nothing. Kinda getting stumped. I searched the forums, google and maybe I'm just having a real tired moment today... I know it has to do with the NAS/Login since I can run it... unless Excel is trying to pop up something that is causing it to fail...
Anyone see anything like this? ](*,)
Comments
2) Have you tried to run the NAS as service under your account?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I am logged as administrator. When I run the process manually from NAV client, everything works fine.
When it is processed on nas (under the same user) it ends with the error described in first post.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Mind you what I wrote wasn't a complete office open xml solution (if it was I would share it) it completed everything I needed and makes saving .xls files (in xml) and being able to email them SIGNIFICANTLY faster using the same methods of AddColumn etc that Excel Buffer offered. Only difference is users have to open the file opposed to it being automatically opened.
"Profanity is the one language all programmers know best."
http://social.msdn.microsoft.com/Forums ... 421818ef91
I had to create the Desktop folder on windows 2008 64 bit server as they mentioned and it started working under NAS.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for this wonderful trick. Unfortunately even after creating this desktop folder, still I am getting same error.
Actually I have two server ( in two separate country ). In one server , NAS is running under a service account and I created the desktop folder and after that it worked absolutely fine.
In other server, NAS is running under a user account ( and that user account has been granted to log on as service ) and here also I created desktop folder and assigned full access to that folder and APPDATA folder for this user account ( rather I gave everyone read/write permission ) and still getting the same error message.
Am I missing something?
Thanks in advance.
Regards,
Sayan
try, try, try......
SaveWkrSpace(FileName : Text[250])
XlApp.Visible(FALSE);
//>TB20190516
//XlWrkSht.SaveAs(FileName);
//XlWrkBk.SaveAs(FileName);
XlWrkBk.SaveCopyAs(FileName);
//<TB20190516
XlWrkBk.Close(FALSE);
XlApp.Quit;
CLEAR(XlApp);
Although the system is 64 bit, it was necessary to add folders in both locations:
C:\Windows\SysWOW64\config\systemprofile\Desktop
C:\Windows\System32\config\systemprofile\Desktop
after that everything works fine