Hi Guys,
I cannot understand the logic in here. I am pretty much sure it should generate and error but it does not. It just adds me another Worksheet named according to regular pattern (Sheet4, Sheet5, etc.)
I want to get an error just to skip creation with error handling and proceed to next loop iteration.
Why is that.
Regards,
Witek
I cannot understand the logic in here. I am pretty much sure it should generate and error but it does not. It just adds me another Worksheet named according to regular pattern (Sheet4, Sheet5, etc.)
I want to get an error just to skip creation with error handling and proceed to next loop iteration.
Why is that.
Code:
Sub addSheets()
Dim CurrDayBook As Workbook
Set CurrDayBook = Workbooks.Open("something.xls")
CurrDayBook.Sheets.Add.Name = "dupa"
CurrDayBook.Sheets.Add.Name = "dupa"
End sub
Regards,
Witek
Last edited: