Hi,
I have a workbook with some macros. I've been using the same workbook for almost 8 months and have had no problems. Today, I ran one of the macros and received an error. The reason for the error was that my code was trying to select sheet2 (Sheet2.Select). When I looked in the project explorer window, I saw that the worksheet that used to be called sheet2 was now labeled sheet21. Additionally, there is a new object called sheet2, but it is not a worksheet, it seems to be a workbook (the icon is not a worksheet icon).
I usually refer to worksheets in my code by using the worksheet number instead of the worksheet name because I thought the worksheet number was never changed (people using the workbook will sometimes change the names of the worksheets).
I'm sure something was done inadvertently as other people have access to the same workbook. I would just like to know what was done and how I can avoid it in the future. Any help is appreciated. Thanks.
I have a workbook with some macros. I've been using the same workbook for almost 8 months and have had no problems. Today, I ran one of the macros and received an error. The reason for the error was that my code was trying to select sheet2 (Sheet2.Select). When I looked in the project explorer window, I saw that the worksheet that used to be called sheet2 was now labeled sheet21. Additionally, there is a new object called sheet2, but it is not a worksheet, it seems to be a workbook (the icon is not a worksheet icon).
I usually refer to worksheets in my code by using the worksheet number instead of the worksheet name because I thought the worksheet number was never changed (people using the workbook will sometimes change the names of the worksheets).
I'm sure something was done inadvertently as other people have access to the same workbook. I would just like to know what was done and how I can avoid it in the future. Any help is appreciated. Thanks.