want to know how to write to an existing excel sheet

want to know how to write to an existing excel sheet

Page 1 of 1

1 Replies - 5487 Views - Last Post: 14 March 2008 - 06:24 AM Rate Topic: -----

#1 raju1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-February 08

want to know how to write to an existing excel sheet

Posted 14 March 2008 - 12:45 AM

Dim ExcelSheet As Object

Set ExcelSheet = CreateObject("Excel.sheet")
ExcelSheet.Application.Visible = True

ExcelSheet.Application.Cells(2, 1).Value = "Testcase_id"
ExcelSheet.Application.Cells(2, 2).Value = "Expected"
ExcelSheet.Application.Cells(2, 3).Value = "Actual"
ExcelSheet.Application.Cells(2, 4).Value = "Result"

If actual_result = passed Then

ExcelSheet.Application.Cells(3, 1).Value = "RCUI_TT_AUTT_002"
ExcelSheet.Application.Cells(3, 2).Value = "work manager page displayed"
ExcelSheet.Application.Cells(3, 3).Value = "work manager page displayed"
ExcelSheet.Application.Cells(3, 4).Value = "pass"
Else
ExcelSheet.Application.Cells(3, 1).Value = "RCUI_TT_AUTT_002"
ExcelSheet.Application.Cells(3, 2).Value = "work manager page displayed"
ExcelSheet.Application.Cells(3, 3).Value = "work manager page not displayed"
ExcelSheet.Application.Cells(3, 4).Value = "Fail"

End If



Above is the code to create and write to an excel sheet.
After I do this to the first test case script result, I want to open the same saved excel sheet from the path and write to this file? Can anyone help me?

This post has been edited by PsychoCoder: 14 March 2008 - 06:22 AM


Is This A Good Question/Topic? 0
  • +

Replies To: want to know how to write to an existing excel sheet

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: want to know how to write to an existing excel sheet

Posted 14 March 2008 - 06:24 AM

After you call the save method to save that file you will be required to provide a path and a file name. Keep track of that path & name, then pass it to the open command when you want to open that same file up again.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1