This error happens in the Read CSV Module.
There is something funky going on with this code.
In the code, I pass an argument to a function, GetDate. The argument is a file name with like "ABC_yyyymmdd.csv" and the function is designed to return the string MMM DD. As an intermediate step in the function, it changes the parameter passed to it to YYYYMMDD. It also changes the name of the file in the calling program. FileName is NOT a global. I "worked around" the issue with a two-step and created a variable called DateName and it gets destroyed by the parsing process.
I don't think I am doing anything to change where dir is pointing.
Attached is the file, the misbehaving macro is AddPages. The zip file contains test CSV files. Cells B1 and B2 on the control panel can be used to configure where these CSV files are read and where they get deposited to when they are processed. So you should be able to replicate the issue.
Bookmarks