﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / Need to delete last row in Excel sheet using SSIS script task / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 14:58:25 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>I am trying to do something similar, but I cannot figure out how to close the excel instance from task manager. Any assistance? code snippet belowPublic Sub Main()        '        Dim objExcel As Object        objExcel = CreateObject("Excel.Application")        objExcel.Workbooks.Open("*.xls")        objExcel.displayalerts = False        objExcel.Sheets("*").Select()        objExcel.rows("2:50000").delete()        objExcel.Workbooks(1).Save()        objExcel.Workbooks.Close(False)        objExcel.displayalerts = True        objExcel = Nothing</description><pubDate>Wed, 10 Oct 2012 12:39:23 GMT</pubDate><dc:creator>sbkotcd</dc:creator></item><item><title>RE: Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>Thanks sneh.it is working fine....</description><pubDate>Tue, 10 Jul 2012 06:04:17 GMT</pubDate><dc:creator>raghavatgk</dc:creator></item><item><title>RE: Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>try using sql script task-Dim filename As String        Dim appExcel As Object        Dim newBook As Object        Dim oSheet1 As Object        Dim cell As String        Dim rowcount As Int16        appExcel = CreateObject("Excel.Application")        filename = "C:\Documents and Settingsbkrrov\Desktop\test.xls"        appExcel.DisplayAlerts = False        newBook = appExcel.Workbooks.Open(filename)        oSheet1 = newBook.worksheets("Sheet1")        rowcount = oSheet1.UsedRange.Rows.Count()        cell = "A" + rowcount.ToString        oSheet1.Range(cell).Entirerow.Delete()        With newBook            .SaveAs(filename, FileFormat:=56)        End With        appExcel.Workbooks.Close()        appExcel.Quit()ThanksSneh</description><pubDate>Tue, 10 Jul 2012 05:35:52 GMT</pubDate><dc:creator>snsingh</dc:creator></item><item><title>RE: Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>Hi to all.i didnt got any reply . am i missing any information ?</description><pubDate>Tue, 10 Jul 2012 05:01:34 GMT</pubDate><dc:creator>raghavatgk</dc:creator></item><item><title>RE: Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>Thanks jitendra.  i will try your solution. But i am looking for Script Task.Thanks in advance.:-)</description><pubDate>Mon, 09 Jul 2012 12:16:25 GMT</pubDate><dc:creator>raghavatgk</dc:creator></item><item><title>RE: Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>1. Connect to the excel sheet using JET oledb.2. Query the whole sheet and create a datatable which contains the excel data now.3. Delete the first row of Datatable.4. Update the datatable using Dataadapter (This will update the change to excel)ORUse update command as below:update `Sheet Name`set [Column Name]=null where [Condition Column Name] = 'Sample'</description><pubDate>Mon, 09 Jul 2012 11:57:10 GMT</pubDate><dc:creator>jitendra.padhiyar</dc:creator></item><item><title>Need to delete last row in Excel sheet using SSIS script task</title><link>http://www.sqlservercentral.com/Forums/Topic1327014-1292-1.aspx</link><description>Hi to all.I need to delete last row in excel in sheet using ssis task. can any help me regarding this?Please do let me know in case of any additional information required.Thanks in advance.</description><pubDate>Mon, 09 Jul 2012 11:49:47 GMT</pubDate><dc:creator>raghavatgk</dc:creator></item></channel></rss>