Solved

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

Posted on 2010-09-21
1
1,531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

726 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