Solved

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

Posted on 2010-09-21
1
1,462 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

758 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now