Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting the excel sheet before exiting the script
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,
What about the following script.
It creates an excel file with 5 sheets.
Then removes the second sheet.
You will find the mentioned sheet deleted from the workbook.

Let me know whether it works out for you or not!

Code:
Set xls=createobject("excel.application")
Set xls1=xls.workbooks.add
For i=0 to 4
xls1.worksheets.add
next

xls.worksheets(1).name="Browsers"
'xls.worksheets(2).delete
xls1.saveas"E:\Child Object Properties2.xls"
xls.save
xls.quit
Set xls=nothing
Set xls1=nothing
Reply


Messages In This Thread
RE: Deleting the excel sheet before exiting the script - by Rekha - 08-14-2008, 05:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to create List box in excel sheet at Run time with values yes No JACKSPARROW 0 1,714 01-17-2017, 11:05 AM
Last Post: JACKSPARROW
  Excel and Driver Script shipu 1 3,825 02-27-2014, 09:09 AM
Last Post: supputuri
  Custom sort -Excel Sheet kiran 1 3,868 01-28-2014, 09:23 AM
Last Post: supputuri
  Can we save an exported Excel sheet directly from QTP? Akhila 2 3,468 11-28-2013, 10:30 AM
Last Post: Akhila
  How to identify the object reference to the existing(already opened) Excel sheet yogeesh 1 9,968 09-26-2012, 07:00 PM
Last Post: krr

Forum Jump:


Users browsing this thread: 3 Guest(s)