[THIN] OT: vbscript & excel question

  • From: Steve Snyder <kwajalein@xxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Mon, 8 Aug 2011 12:42:11 +0200

So I'm able to create/open a workbook and rename the default 3 worksheets.
How in the heck do I add a fourth (or fifth, sixth...) worksheet?


Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
objWorkbook.Worksheets(1).name = "Sheet 1 of 4"
objWorkbook.Worksheets(2).name = "Sheet 2 of 4"
objWorkbook.Worksheets(3).name = "Sheet 3 of 4"

Other related posts: