Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete rows into data sheet
#4
Solved: 10 Years, 9 Months, 3 Weeks ago
Once again, I couldnt find a direct method, Here's a workaround though export datatable to excel sheet, open excel sheet and delete the required row. Import back the new datatable (or sheet or whatever).


Hope the below code helps!
********************************
Code:
datatable.ImportSheet "C:\Documents and Settings\jemuthyala\Desktop\F5ventures.xls","Chess","Chess"
'                        intcolumnCount = DataTable.GetSheet("Chess").getrowcount
'                        msgbox intcolumncount
'                        datatable.SetCurrentRow (2)
'                        Doc_Number= 2
'                        DataTable("Men_Singles",dtLocalSheet)= Doc_Number
datatable.exportSheet "C:\Documents and Settings\jemuthyala\Desktop\F5ventures.xls","Chess"
                         Set objExcel = CreateObject("Excel.Application")
                         Set objWorkbook = objExcel.Workbooks.Open("C:\Documents and Settings\jemuthyala\Desktop\F5ventures.xls")
                         objExcel.Visible = True
                          Set objWorksheets = objworkbook.sheets ("Chess")
                          objworksheets.select
                          objworksheets.rows (1).delete ' Insert logic to selcet rows that are to be deleted.
                        datatable.ImportSheet "C:\Documents and Settings\jemuthyala\Desktop\F5ventures.xls","Chess","Chess"
Reply


Messages In This Thread
Delete rows into data sheet - by hajjf - 03-18-2008, 01:35 AM
RE: Delete rows into data sheet - by Cpt.Zack - 03-19-2008, 04:05 PM
RE: Delete rows into data sheet - by hajjf - 03-19-2008, 08:13 PM
RE: Delete rows into data sheet - by Cpt.Zack - 03-21-2008, 11:40 PM
RE: Delete rows into data sheet - by hajjf - 03-25-2008, 07:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,189 01-03-2020, 09:30 PM
Last Post: Bhuvana
  Delete Firefox history and Cookies Anupama 0 1,329 06-18-2018, 11:57 AM
Last Post: Anupama
  Reading data from excel sheet serenediva 1 8,963 03-03-2017, 10:07 AM
Last Post: vinod123
Question QTP not performing iterations based on local data sheet Breaker 18 55,382 01-25-2016, 04:32 PM
Last Post: arunshuklainbox
  Importing data sheet Santu 2 3,222 08-20-2015, 11:37 PM
Last Post: ADITI1992

Forum Jump:


Users browsing this thread: 1 Guest(s)