[prev in list] [next in list] [prev in thread] [next in thread] 

List:       thin
Subject:    [THIN] Re: OT: vbscript & excel question
From:       Steve Snyder <kwajalein () gmail ! com>
Date:       2011-08-08 10:51:17
Message-ID: CABnfk2YQUauz_zEw6x+U9vLZjs=cHmvO5aqGfBREV2uXtP90RA () mail ! gmail ! com
[Download RAW message or body]

<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@gmail.com> 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"
>

[Attachment #3 (text/html)]

&lt;sigh&gt; I always search for a while, then post here, then find my solution 3 \
seconds later...<br><br><div class="gmail_quote">On Mon, Aug 8, 2011 at 12:42 PM, \
Steve Snyder <span dir="ltr">&lt;<a \
href="mailto:kwajalein@gmail.com">kwajalein@gmail.com</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;">So I&#39;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?<br> <br><br>Set objExcel = \
CreateObject(&quot;Excel.Application&quot;)<br>objExcel.Visible = True<br> Set \
objWorkbook = objExcel.Workbooks.Add()<br></blockquote><div> objWorkbook.Sheets.Add \
,objWorkbook.Sheets(objWorkbook.Sheets.Count),19 <br></div><blockquote \
class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, \
204, 204); padding-left: 1ex;"> objWorkbook.Worksheets(1).name = &quot;Sheet 1 of \
4&quot;<br>objWorkbook.Worksheets(2).name = &quot;Sheet 2 of \
4&quot;<br>objWorkbook.Worksheets(3).name = &quot;Sheet 3 of 4&quot;<br> \
</blockquote></div><br>


************************************************
For Archives, RSS, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://www.freelists.org/list/thin
************************************************

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic