How can i write this selected cell value into another predefined cell in Excel using script component or other tools

Who is online?  0 guests and 0 members
Home  »  Forums   »  microsoft business intelligence   »  integration services   » How can i write this selected cell value into another predefined cell in Excel using script component or other tools

How can i write this selected cell value into another predefined cell in Excel using script component or other tools

Topic RSS Feed

Posts under the topic: How can i write this selected cell value into another predefined cell in Excel using script component or other tools

Posted: 1/16/2012

Jedi Youngling 16  points  Jedi Youngling
  • Joined on: 10/9/2011
  • Posts: 8

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()      

    End Sub

    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 Sub

End Class

====================================================================================

Can you please help me.

Thanks and regards bsingha.


tags excel, cell
Page 1 of 1 (1 items)