I have a Module that has operated great for years, but now on a new computer, it is fails. The error message I receive is runtime error #9, which is subscript out of range.
I recognized the problem to be that it did not like the reference:
The module works if I change the code to:
This is great, except for the program is used for data logging and I do not want it to start logging data on another book that I go look at while the code is looping and storing the data.
1) I am curious as to why the
format is not being accepted as the first workbook open.
2) My plan is to change the code so that the active workbook when the module is run redefines the workbook to a specific name and uses the specific name throughout the module in all data logging loops. Does anyone see any problems with the strategy?
I recognized the problem to be that it did not like the reference:
Code:
Workbooks(1).Worksheets("Corrected Data").Range("B8", "AY8") = Workbooks(1).Worksheets("Raw Data").Range("B9", "AY9").Value
The module works if I change the code to:
Code:
ThisWorkbook.Worksheets("Corrected Data").Range("B8", "AY8") = Workbooks(1).Worksheets("Raw Data").Range("B9", "AY9").Value
This is great, except for the program is used for data logging and I do not want it to start logging data on another book that I go look at while the code is looping and storing the data.
1) I am curious as to why the
Code:
Workbooks(1).Worksheets("Corrected Data").Range("B8", "AY8")
2) My plan is to change the code so that the active workbook when the module is run redefines the workbook to a specific name and uses the specific name throughout the module in all data logging loops. Does anyone see any problems with the strategy?