Hi,
I have the following Macro:
I get Runtime error, subscript out of range on "Get Data" code and I see the macro has opened the same file three times with a number at the end (1, 2 ,3) to denote which file version.
The "Get Data" code is also highlighted yellow as it causes the error. I've run the same macro on multiple files but I get this error on a particular file (All files are in same format)
The file name worksheet only has unique name (no duplicates). Any feedback or fix is highly appreciated.
Thanks
I have the following Macro:
Code:
'--- Reads File Name from Filenames Worksheet ---'
Windows(Master).Activate Sheets("Filenames").Select
datafile = Range("A" & cntLDC)
'--- Opening File ---'
Workbooks.Open Filename:= _
"U:\OPERATIONS\Reports\" & datafile, UpdateLinks:=0
'--- Get Data ---'
Windows("" & datafile).Activate
I get Runtime error, subscript out of range on "Get Data" code and I see the macro has opened the same file three times with a number at the end (1, 2 ,3) to denote which file version.
The "Get Data" code is also highlighted yellow as it causes the error. I've run the same macro on multiple files but I get this error on a particular file (All files are in same format)
The file name worksheet only has unique name (no duplicates). Any feedback or fix is highly appreciated.
Thanks