Community discussion forum

ActiveWorkbook.Worksheet

Tags: Belgium
  • 2 years ago
    I'm makin a script to make an inventory of what is in my computer and the problem is that this works:

    Set objblad = objExcel.ActiveWorkbook.Worksheets(1)
        objblad.Name = "Lokaal"
    set objblad2 = objExcel.activeworkbook.worksheets(2)
        objblad2.Name = "Processor"
    set objblad3 = objExcel.activeworkbook.worksheets(3)
        objblad3.Name = "OS & SP"

    Until i add:

    set objblad4 = objExcel.activeworkbook.worksheets(4)
        objblad4.Name = "Domein"

    I think it's got something to do with Excel having only 3 startup worksheets but i'm not sure.















  • 2 years ago

    Sure is!!

    dunno if ur still looking for an answer but:

     

    worksheets.Add
    worksheets("Sheet4").name ="Domein"

  • 2 years ago
    I gave up on the project some time a go, but knowing this, i might give it another try, thank you

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback