You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I execute my program with a Windows Scheduled Task the method Open() returns null.
using (var word = new Word.Application())
{
if (!File.Exists(wordFile.FullName)) // => file exists
throw new FileNotFoundException(wordFile.FullName);
var document = word.Documents.Open(wordFile.FullName); // => document is null
if (document == null)
throw new Exception($"Document null : {wordFile.FullName}"); // => Exception here
}
I my scheduled task running under the administrator account I checked :
"Execute even if user is not connected"
"Execute with maximal authorisations"
It only works if the administrator account is logged in, which is not possible to keep on a server, especially after a reboot.
Is it possible to work without active user session?
Thanks for your help.
Note : I am currently using the latest NuGet package : NetOffice.Word 1.7.4.11.
The text was updated successfully, but these errors were encountered:
glautrou
changed the title
Word.Documents.Open() null on Word 2019
Does not work when ran with scheduled tasks
Jun 11, 2021
For questions about system integration and/or implementation for specific use case please post your question to https://stackoverflow.com/ with tag [netoffice]
Hi,
When I execute my program with a Windows Scheduled Task the method
Open()
returnsnull
.I my scheduled task running under the
administrator
account I checked :It only works if the
administrator
account is logged in, which is not possible to keep on a server, especially after a reboot.Is it possible to work without active user session?
Thanks for your help.
Note : I am currently using the latest NuGet package : NetOffice.Word 1.7.4.11.
The text was updated successfully, but these errors were encountered: