Avatar of DuBoisCG
DuBoisCG

asked on 

Creating Microsoft Word Object in Thread Fails on Deployed Workstation

I am running some office automation in a thread.  This works on my development machines, but fails when deployed.  If I run the same code outside of a thread, it works on all machines.  Does anyone have any ideas?  I became so frustrated that I created the most basic non-class driven automation to make sure I wasn't going crazy:

Attached are two files, same program but one calling via thread the other direct.

 Works.txt

 Fails.txt
Programming.NET ProgrammingProgramming Languages-Other

Avatar of undefined
Last Comment
DuBoisCG
Avatar of Anurag Thakur
Anurag Thakur
Flag of India image

The first reason that comes to my mind in such a scenario when something works on development machine and not on deployment machine is the permissions of user under whose credentials the code/application is running under

generally on dev machines we always have admin rights and when we deploy the user credentials the application is using is generally restricted
Avatar of DuBoisCG
DuBoisCG

ASKER

It's a good thought, but the working test (same code, just not in a thread) runs as the local user.

I actually got it working by adding the office.dll into the working directory, but want to leave this issue open to see if anyone can explain why this dll wasn't required for the working test.  If there are some important rules for threads that limit their ability to access resources, it would be nice to document it here (couldn't find much threaded function help).
ASKER CERTIFIED SOLUTION
Avatar of Anurag Thakur
Anurag Thakur
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of DuBoisCG
DuBoisCG

ASKER

We still don't know why the same code would run outside a thread on the same machine as the same user... but ultimately it needed the referenced dll in the working directory in order for the thread version to run.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo