vb script code - do i need excel installed

  • hello,

    before saying anything i did went through the posts here i found something similiar but not exactly what i need..i have a SSIS package migrated from DTS...the package pulls the data and then there is one active x script task which copies the data in an excel template..mentioned below is the initial code

    Set xlApp = CreateObject("Excel.Application")

    xlApp.Workbooks.Open "C:\TEMPLATE.xls"

    'Clear the Spreadsheet

    xlApp.Sheets.Item("Relationship Level").Select

    xlApp.Rows(2).RowHeight = 0

    xlApp.Range("A3:A65536").EntireRow.Delete

    i understand that for some tasks i do not need excel installed...but when i try to run the task it throws error:

    [ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x1C94C538.

    do i need excel on the server.from my understanding the script is using some excel functionalities and since i do not have excel installed it is throiwing that error..any suggestions please let me know.

  • It is not recommended practice as the Excel object is well know for not closing correctly. but to do what you want you will need to install Excel or purchase a third party add on.

    However, as long as you are using SSIS you can make and Excel spread sheet using the Excel Destination without installing Excel. I am using this approach and it work well.

    Alan

  • thanks Alan for responding...yeah i understand that i do not need Excel to import any data from a db...but my script uses some excel functionality ..and i get the error which i mentioned in my previous post...yeah ..i would assume i need the software inorder to make it work...

  • You could create record set object and since the Excel script is fairly close and modify the recordset to output to a simple worksheet.

    Just a thought

  • how do i create a record set object ...please let me know..thanks..

  • A record set in nothing more than a variable of type object.

    In you data source you have a choice of destinations. Just set this destination to the variable and the data will be there. I usually use tsql to create empty columns prior to inserting to the record set as I don't like mucking about with adding column in script. The you place a script task new and pass in the variable as a read write object and write script to hearts content.

    Then pump it out to an Excel destination and you will have your data.

    Hope that helps,

    Alan

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply