The program fails on the last line where it's supposed to close the workbook (without saving changes) that it previously opened at the user's specification. The only purpose in opening the workbook is copying over data from yesterday's report into today's workbook so a vlookup function can be utilized. I tried declaring the variables as Dim within the procedure, I tried using double quotes in the parenthesis in the last line, I tried using a String instead of Variant, which is the version I'm sharing here; previously I wasn't trying to use 'wbName' at all, only tried to call 'FileName' when attempting to close the workbook. The error that always comes up on the last line in the procedure is:
Run-time error 9 -- Subscript out of Range
The variable has been declared so I can't understand what they're talking about.
Please Login or Register to view this content.
Bookmarks