Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set the column header in the excelsheet before importing it to local datasheet
#3
Solved: 10 Years, 9 Months, 2 Weeks ago
Hi thanks, i found the solution.

Code:
Set ExcelObj =  CreateObject("Excel.Application")
ExcelObj.Workbooks.Add
Set NewSheet = ExcelObj.Sheets.Item(1)
NewSheet.Name = "CTO"
NewSheet.Cells(1,1).Value = "Sno"
NewSheet.Cells(1,2).Value = "C1"
NewSheet.Cells(1,3).Value = "O1"
ExcelObj.ActiveWorkbook.SaveAs "C:\CTO_TD.xls"
' close the application and clean the object
ExcelObj.Quit
Set ExcelObj = Nothing
Reply


Messages In This Thread
RE: Set the column header in the excelsheet before importing it to local datasheet - by nageshpv - 08-04-2008, 04:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  export UFT datasheet to excel and then append Mozza 0 1,660 09-04-2018, 08:58 AM
Last Post: Mozza
  to count the number of used rows in a particular column sujaravi123 3 10,938 06-12-2013, 03:17 PM
Last Post: sujaravi123
  Importing excel not working Adam82 6 13,179 11-05-2012, 05:22 PM
Last Post: Adam82
  GetRowWithCellText does not work if the header has a colspan ConstantChange 6 7,143 05-08-2012, 04:19 PM
Last Post: Mahmoud.Karam
  How to recognize table row and column siwani 4 4,834 04-05-2012, 05:06 PM
Last Post: verma.vik6

Forum Jump:


Users browsing this thread: 1 Guest(s)