Job failed while executes VbScript to import a value from excel file (Windows Server 2008)

baluas (1 post)
April 1, 2010 07:52 AM
Accepted Answer

We got an issue when accessing excel file using vbscript executed by AdTempus application Job. This issue occurs only in windows Server 2008 operating system, while in Windows Serwer 2003 the same vbs and the same scenario works well. We have tried manipulating on "User's Interaction" modes in AdTempus->Job->Settings dialog window. When there was selected "User Session" and the user(same as job "User Account" ) was logged-in - the script has been executed without errors but when user was logged-out and when was "Hidden" mode the same job scheduled for execution returned following error below:

 ------------------------------------------------------

 Script execution failed: Microsoft Office Excel cannot access the file 'C:\test\test.xls'. There are several possible reasons:

 • The file name or path does not exist.

 • The file is being used by another program.

 • The workbook you are trying to save has the same name as a currently open workbook. (1004) (Line 22, Column 0)

 ------------------------------------------------------

 In all other cases of "User's Interaction" mode under Windows Serwer 2008 appering the error(ss1.jpg)At Windows Serwer 2003 the same script was executed in "Hidden" and "User's Session, Hidden" modes without any issues - independantly was an user logged-in or logged-out. In both operating systems versions and  configurations of MS Excel 2007 were the same.

Please advice how to fix this issue.

Kind regards,

as

 

J.D. Staff (46 posts)
April 1, 2010 01:51 PM
Accepted Answer

Please keep in mind that Microsoft does not recommend or support server-side Automation of Office (see MS KB article 257757), and that applies to your scenario.

I think your problem is probably related to changes to user session isolation beginning in Vista/Server 2008. When you use the "Hidden" interaction model, adTempus launches the job into Windows session 0, which is not intended for interactive or GUI-based programs. Session 0 works differently beginning with Vista/2008, and this can cause problems. Especially for programs like Excel that are written to assume they will be running interactively.

The problem you're having with Excel seems to be common. You can find some discussion here and here but I don't think the workarounds they are discussing will work for you because in your case adTempus is running your script under a user account not under the system account.

One thing you can try if you're not already is run the job under an Administrator account with the "Run with highest privileges" box checked and see if that makes a difference.

If you are using 64-bit Windows take a look at the end of this discussion (look for the message posted on March 12, 2010) and try that suggestion for forcing your script to run as a 32-bit script. No idea if that will make a difference for you.

If anyone else is successfully automating Excel on Vista/2008 please chime in.
Bill Staff (599 posts)
February 3, 2011 03:04 PM
Accepted Answer

We have found that there is a workaround for this problem. See KB article K00000375 for more information.

Replies are disabled for this topic.