2
votes

excel 2007

i have the following which happily creates a workbook and worksheet. How can i create another worksheet in the same workbook?

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = False

Set XLDoc = objExcel.Workbooks.Add

Set XLSheet = XLDoc.Worksheets(1)
1

1 Answers

4
votes
    objExcel.ActiveWorkbook.Worksheets.Add