sam314159
04-30-2010, 12:58 PM
I've been running a macro for the last year or so that has the following code in it:
Workbooks(1).Sheets(3).Activate
This has been working perfectly until now. I am getting a "Subscript Out Of Range" error and when I put a watch on Workbooks(1) I found out that it is now "PERSONAL.XLS" which is not even open. Workbooks(1) has always been the first workbook I opened and now it's not.
I don't want to hard code the name of the workbook because it can sometimes change. Everything works out fine if I change the reference to Workbooks(2) but no one else is having that problem but me and we are sharing this macro.
Any ideas on how to fix this?
Workbooks(1).Sheets(3).Activate
This has been working perfectly until now. I am getting a "Subscript Out Of Range" error and when I put a watch on Workbooks(1) I found out that it is now "PERSONAL.XLS" which is not even open. Workbooks(1) has always been the first workbook I opened and now it's not.
I don't want to hard code the name of the workbook because it can sometimes change. Everything works out fine if I change the reference to Workbooks(2) but no one else is having that problem but me and we are sharing this macro.
Any ideas on how to fix this?