Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding a namespace that doesn't exist for a SSIS Script Transformation

Posted on 2016-11-08
3
Medium Priority
?
112 Views
Last Modified: 2016-11-08
I need to add the Microsoft.Office.Interop.Excel namespace reference so I can apply an Excel macro in a SSIS Script Transformation Component.  When I edit the Script Transformation and go to add a Reference, Microsoft.Office.Interop.Excel does not exist.  I've made sure that .NET Programmability Support was selected when I installed Microsoft Office and I've also installed the Visual Studio 2010 Tools for Office Runtime.

The code I need to add looks like this but it don't build without the namespace reference.  Thanks!!
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWorkBook = xlApp.Workbooks.Open("C:\\ExcelDirectory\\DATA.xlsm"); // absolute path needed
xlApp.Run("Formatting"); // method overloads allow you to send it parameters, etc.
xlWorkBook.Close(true); // first parameter is SaveChanges
xlApp.Quit();

Open in new window

0
Comment
Question by:Basssque
[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
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Megan Brooks earned 2000 total points
ID: 41879189
It's actually the assembly reference that you need to add, before your code will be able to use the namespace. I haven't had to do this myself, but here's an article from 2011 that describes steps (that I have not tested).

SSIS Script Task and Microsoft Office Automation
1
 

Author Closing Comment

by:Basssque
ID: 41879242
That was helpful.  I installed the Primary Interop Assemblies Redistributable and it showed up under COM/Type Libraries opposed to Assemblies
0
 
LVL 16

Expert Comment

by:Megan Brooks
ID: 41879281
The labeling may depend on the version of SSIS/VSTS. Adding assembly references generally is straightforward for assemblies installed in the GAC, which is evidently where the redistributable installs this set.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

597 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