Posted: 1/16/2012
How can i write this selected cell value into another predefined cell in Excel using script component or other tools?
I have installed Office 2003Primary Interop Assemblies and Add Reference Microsoft Office 11 Object Library
but Imports Microsoft.Office.Interop.Excell can not work.
=============================== Code ================================
' Microsoft SQL Server Integration Services Script Component
' Write scripts using Microsoft Visual Basic 2008.
' ScriptMain is the entry point class of the script.
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports Microsoft.Office.Interop.Excel -> unable to imports this line
<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute> _
<CLSCompliant(False)> _
Public Class ScriptMain
Inherits UserComponent
Public Overrides Sub PreExecute()
MyBase.PreExecute()
End Sub
Public Overrides Sub PostExecute()
MyBase.PostExecute()
Public Overrides Sub CreateNewOutputRows()
Dim objExcel As Object = CreateObject("Excel.Application")
Dim objBook As Object = objExcel.Workbooks.open("C:\BI Integration Development Studio\Read-XL.xls")
Dim objSheet As Object = objBook.Workbooks(1)
Output0Buffer.AddRow()
Output0Buffer.Date = CDate(objSheet.Range("B2").value)
End Class
====================================================================================
Can you please help me.
Thanks and regards bsingha.