Add New Worksheet through VBS COM Object

J

jgreer9514

I have a problem when I try to add a worksheet through the EXCEL COM object
it adds Sheet4 in front of Sheet1, Sheet2, Sheet3. I want it to add the
sheet at the end of the sheets. The following code does not work from a .vbs
external script.
Excel Code:
ActiveWorkBook.Sheets.Add after:Worksheets(Worksheets.Count)

I have tried externally:
ExcelApp.WB.Sheets.Add (after:=Sheet3)

What to put in statement after Add?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top