I've recently started training a coworker using macros that exist as a package (the macro file itself, a template, and reports that get generated based on the template).
I copy all relevant files to this user's desktop (which is where I put my copy) and rename every instance where the code referenced a C: location to match this user's C: filepaths.
Thinking that all is well, I give the macro some user inputs (Mold and Lot, shown below) and run.
I get a Runtime Error 9: subscript out of range.
It seems that the macro can't reference a range even in the same workbook.
I've checked spelling, and switched the order of the Mold and Lot - both orders behave the same. Whichever line comes first gets the Runtime Error 9.
When I run this macro on my account, even the same computer, it works fine.
Is there any reason why a macro wouldn't work for another user even if everything seems to be the same?
I copy all relevant files to this user's desktop (which is where I put my copy) and rename every instance where the code referenced a C: location to match this user's C: filepaths.
Thinking that all is well, I give the macro some user inputs (Mold and Lot, shown below) and run.
I get a Runtime Error 9: subscript out of range.
VBA Code:
Mold = Workbooks("SQL Query").Worksheets("SQL Data").Range("A5").Value
Lot = Workbooks("SQL Query").Worksheets("SQL Data").Range("A3").Value
It seems that the macro can't reference a range even in the same workbook.
I've checked spelling, and switched the order of the Mold and Lot - both orders behave the same. Whichever line comes first gets the Runtime Error 9.
When I run this macro on my account, even the same computer, it works fine.
Is there any reason why a macro wouldn't work for another user even if everything seems to be the same?