Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel Save as Method
#4
Solved: 11 Years, 6 Months, 3 Weeks ago
Hi Chanda,

Use this code

Code:
TestSuitFileLocation = "H:"
TestSuitFileName = "H:\Book.xls"
TestSuitFileNewName = "NewFile.xls"
Set excelApp = CreateObject("Excel.Application")
excelApp.Visible = True
Set TestSuiteExcelFile = excelApp.Workbooks.Open(TestSuitFileName)
excelApp.DisplayAlerts = False
TestSuiteExcelFile.SaveAs TestSuitFileLocation & "\" & TestSuitFileNewName
TestSuiteExcelFile.Close
excelApp.DisplayAlerts = True
excelApp.Quit
Set excelApp = Nothing

Suppressing the alert messages (excelApp.DisplayAlerts = False and excelApp.DisplayAlerts = True) will save you the trouble.

HTH.

Cheers,
Vijayendra
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,366 12-09-2013, 07:32 AM
Last Post: basanth27
  Get values from dropdown the. Save it to excel Sm8422 1 4,823 06-11-2012, 09:44 AM
Last Post: ravi.gajul
  Save or Save As not working for QTP 11 Nick 1 3,357 08-13-2011, 12:16 PM
Last Post: vaddevinod
  Save Excel file mv8167 4 28,484 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,577 07-28-2008, 02:14 PM
Last Post: surya_7mar

Forum Jump:


Users browsing this thread: 2 Guest(s)