Micro Focus QTP (UFT) Forums
Delete rows into data sheet - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Delete rows into data sheet (/Thread-Delete-rows-into-data-sheet)



Delete rows into data sheet - hajjf - 03-18-2008

I want to delete certain rows into my data sheet.

Some one can help please ?

Thanks.


RE: Delete rows into data sheet - Cpt.Zack - 03-19-2008

What do you mean by "into my data sheet", Am I reading it wrong or is it supposed to me "in my data sheet"?


RE: Delete rows into data sheet - hajjf - 03-19-2008

Yes exactly,
Deleting certain rows in my data sheet.


RE: Delete rows into data sheet - Cpt.Zack - 03-21-2008

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"



RE: Delete rows into data sheet - hajjf - 03-25-2008

Thanks for your help.