Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduled job does not release Excel

Status
Not open for further replies.

megmoo75

Programmer
Jun 14, 2003
40
0
0
US
I have a DTS package the uses a stored procedure to populate an Excel file (that is created when the DTS runs). The DTS package then uses an ActiveX vbScript to open up a Word Template and mail merge the Excel file with the Word Template to create and save a Word document with the merged data.

When I run the DTS manually, this works fine. All instances of Excel and Word are released when the DTS package completes.

When I run within a schedule job, it never gets to the step where the mail merge takes place because the job seems to be holding the Excel file open, so when Word tries to open the Excel file as its data source, it fails.

The owner of the job (the one running it) is a member of the sysadmin role.

Does anyone have any ideas why the DTS package, when run within a scheduled job, does not release the Excel file, but when run alone, does so just fine?

Thank you in advance for any help you can provide.
 
Hi,

You have to rename the excel file once it is created to manipulate it as you can not manipulate it when the file is open.

Try the following example:

Example: Dts package creates the excel file data.xls
You rename it data_20031103.xls and use this file in your activeX to mail merge.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top