[THIN] Re: OT: vbscript & excel question

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

<sigh> I always search for a while, then post here, then find my solution 3
seconds later...

On Mon, Aug 8, 2011 at 12:42 PM, Steve Snyder <kwajalein@xxxxxxxxx> wrote:

> 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.Sheets.Add ,objWorkbook.Sheets(objWorkbook.Sheets.Count),19

> 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: