Forum Discussion

jeetendra_mitta's avatar
jeetendra_mitta
Occasional Contributor
11 years ago

Adding new sheet in excel workbook.

Can someone post the code to adding any excel sheet in excel workbooks like sheet2, shet3 etc.
  • jmcpeek's avatar
    11 years ago


    Set Excel = Sys.OleObject("Excel.Application")

    set temp = Excel.Workbooks.Open("pathToYourWorkbook")

    call temp.sheets.add()

    temp.activesheet.name = "This is my new worksheet"

    call temp.save