MailMerge from NAS - The type 'Automation' was not defined

RnR
Member Posts: 21
Have set up a job in Job Queue which is started by the NAS. Everything works well on the server if I start the job manually from the classic client. Correct Office version is installed and I have quadruppelchecked the DataTypes and Subtypes.
In CodeUnit 5054 (WordManagement) this line "wrdDoc := wrdApp.Documents.Open(MainFileName);" is giving me the following error: The type 'Automation' was not defined for the function.
Have changed the location of the file, tested with hardcoded paths, checked that the wrdDoc is created, ensured the NAS user can access the folders and files etc etc.
For me it seems like there is something with users and rights running the automation 'Microsoft Word 14.0 Object Library'.Application, but can't figure out what's wrong.
Anything to do with Office 2010?
Any hints?
Cheers
r.
In CodeUnit 5054 (WordManagement) this line "wrdDoc := wrdApp.Documents.Open(MainFileName);" is giving me the following error: The type 'Automation' was not defined for the function.
Have changed the location of the file, tested with hardcoded paths, checked that the wrdDoc is created, ensured the NAS user can access the folders and files etc etc.
For me it seems like there is something with users and rights running the automation 'Microsoft Word 14.0 Object Library'.Application, but can't figure out what's wrong.
Anything to do with Office 2010?
Any hints?
Cheers
r.
0
Comments
-
Yes, try installing Word (or Office) on the server, should help.0
-
Office 2010 is installed on both client and server..0
-
I'm not sure, maybe it could be a license problem?
Thomas0 -
yes, same user, language, fin.flf..
Hmm, can you point me in the right direction about running the NAS as an application and not as a service?0 -
e.g.
nas.exe appservername=NAS,servername=localhost,nettype=TCP,company="My Company",startupparameter=OSYNCH,debug
Parameters are documentet in Installation & System Management: Application Server for Microsoft Dynamics™ NAV (w1w1atas.pdf)
With the debug parameter and a developper's license, the debugger will be active and Break on Triggers will be activated. You can set breakpoints and let it run or just let it run to catch the code line that raises the error.
You don't have to use that parameter though, since the purpose of running nas ineractively here is that the automation server can show prompts and messages. MS Office is notorious for this. But since you run the code from the same user from the client, you should have caught these already. But checking it out does not hurt...0 -
Thanks a lot vaprog!
By running the NAS as an application in debug mode helped me fix a few problems about temp file paths.
At the end, it runs and everything is fine. Shut down the NAS application and started the service NAS, and the same error occurs: "..Automation is not defined for the function".
When I run the NAS as an application I'm logged on to the server with the same domain user as the service NAS uses.
Running code in debug mode can run smooth when it comes to code reading/writing from/to files, but running the same code in normal mode can generate some errors since the file wasn't properly saved before the next line of code was run. So i ran the NAS as an application without debug mode, and that also went fine
Under which user is the application NAS running? Can I set the user?0 -
RnR wrote:When I run the NAS as an application I'm logged on to the server with the same domain user as the service NAS uses.RnR wrote:Under which user is the application NAS running? Can I set the user?
You can check in the task manager. User name column is shown by default.0 -
Hi there,
Did you ever solved the problem? I do have the same problem (also on trying to use mailmerge in the NAS).
The cu works fine when running on a client, works fine when I start the NAS on the command prompt, but fails on opening an (previous saved) XML file when the NAS is started as a service.
More weird: it works perfectly in our development environment!, with the NAS started as a service?
The only difference between development and production is the server (2003 Server SP2 resp 2008 Server SP2)
Of cource, the solution works with the NAS run on the command prompt, but we donot like that solution
Benno0 -
you answered your question in this thread in another thread !
http://www.mibuso.com/forum/viewtopic.php?f=23&t=51723&hilit=word+activeNow, let's see what we can see.
...
Everybody on-line.
...
Looking good!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