Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel Save as Method
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
How to replace existing excel file while using Save as Method ?
For ex:- In the following code if Newfile.xls already exist ,it gives me alert "Do u want to replace it?" .

Code:
TestSuitFileLocation="H:"
TestSuitFileName="H:\Book.xls"
TestSuitFileNewName="NewFile.xls"
    Set excelApp = CreateObject("Excel.Application")
    excelApp.Visible = true
    Set TestSuiteExcelFile = excelApp.Workbooks.Open (TestSuitFileName)    
    TestSuiteExcelFile.SaveAs TestSuitFileLocation& "\"&TestSuitFileNewName
    TestSuiteExcelFile.close
    excelApp.quit
    Set excelApp = Nothing
Reply


Messages In This Thread
Excel Save as Method - by chanda Hemke - 06-21-2010, 01:34 PM
RE: Excel Save as Method - by sreekanth chilam - 06-21-2010, 01:40 PM
RE: Excel Save as Method - by chanda Hemke - 06-21-2010, 02:46 PM
RE: Excel Save as Method - by vijayendra.shukla - 06-23-2010, 09:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP 11.0 Doesn't allow to save excel extracted from BO report. Hema Ganesh.M 1 3,227 12-09-2013, 07:32 AM
Last Post: basanth27
  Get values from dropdown the. Save it to excel Sm8422 1 4,706 06-11-2012, 09:44 AM
Last Post: ravi.gajul
  Save or Save As not working for QTP 11 Nick 1 3,199 08-13-2011, 12:16 PM
Last Post: vaddevinod
  Save Excel file mv8167 4 28,158 07-14-2011, 02:19 AM
Last Post: mv8167
  What is a Method in QTP and how many types are method r there in QTP? vidyabr 1 4,458 07-28-2008, 02:14 PM
Last Post: surya_7mar

Forum Jump:


Users browsing this thread: 1 Guest(s)