Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can we save an exported Excel sheet directly from QTP?
#2
Solved: 10 Years, 10 Months, 2 Weeks ago
You can write those values directly in Excel and Save it where you want by using QTP.

Code:
Set ObjExcel = CreateObject("Excel.Application")
ObjExcel.Visible = TRUE
Set sWorkbook = ObjExcel.Workbooks.Add
Set sWorksheet = sWorkbook.Worksheets("sheet1")

sWorkbook.Worksheets("sheet1").Cells(1,1).Value = "User Name"
sWorkbook.Worksheets("sheet1").Cells(1,2).Value = "Password"

sWorkbook.SaveAs "C:/Book.xls"

Set sWorksheet = Nothing
set sWorkbook = Nothing
set ObjExcel = Nothing
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: Can we save an exported Excel sheet directly from QTP? - by ssvali - 11-26-2013, 03:45 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,707 01-17-2017, 11:05 AM
Last Post: JACKSPARROW
  Not able to click the save button in Save As window while downloading from SAP kathirvelnagaraj 0 2,461 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
  Custom sort -Excel Sheet kiran 1 3,857 01-28-2014, 09:23 AM
Last Post: supputuri
  Save File1.xls as Text File1.txt with save as type - Text(Tab Delimited) Rupesh Singh 0 2,493 03-13-2013, 09:54 AM
Last Post: Rupesh Singh
Exclamation QTP Not accepting method directly dlaureano 0 1,534 02-06-2013, 10:01 PM
Last Post: dlaureano

Forum Jump:


Users browsing this thread: 1 Guest(s)