Solved

SSIS (SQL server agent job) Script Task Error - Cannot create ActiveX component

Posted on 2010-09-21
1
1,509 Views
Last Modified: 2013-11-10
I am running an SSIS package through a SQL server agent job and get this error:
"Source: <my excel macro script task>  Description: The script threw an exception: Cannot create ActiveX component."

When I run this package manually through the solution it runs properly, it's when the SQL server agent job tries to run it that it generates this error.

This package contains a simple script task that calls 2 excel macros in order to modify the source file before importing. This is the only way that I could think of to import a file with dynamic columns (running the macros to modify the column headers and other formatting functions).

Here's my script task sub routine code:

Dim xlapp As Object, wb As Object

xlapp = CreateObject("Excel.Application")
xlapp.visible = True

wb = xlapp.Workbooks.Open(<source file>.xls)

wb.application.Run(<macro1>)
wb.application.Run(<macro2>)

wb.Save()
wb.Close()
xlapp.Quit()

wb = Nothing

Simple, right? I just don't know where I'm going wrong. Any ideas?
As stated above, the error in the SS agent job is pointing to this particular script task.

Thanks,
Katie
0
Comment
Question by:DixieDev
1 Comment
 

Accepted Solution

by:
DixieDev earned 0 total points
ID: 33728569
Excel isn't installed on the server where this package is running through the SS agent.
Oops! Problem solved. :o)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server maintenance plan 8 53
query output (script) from a stored procedure 4 33
Convert VBA UDF to SQl SERVER UDF 4 45
SQL- GROUP BY 4 21
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question