I recorded a macro to pull text file data into a template. I wanted to make it apply to any file I was pulling in, so I replaced the date information in the file name referenced in the code with the wildcard * so that (I assumed) it would just pull in the first file it found in the folder. When I run it, the template file is pulled up - but I get the message:
Run-time error '1004':
The file could not be accessed. Try one of the following:
•Make sure the specified folder exists.
•Make sure the folder that contains the file is not read-only.
•Make sure the file name does not contain any of the following characters: < > ? [ ] : | or *
•Make sure the file/path name doesn't contain more than 218
When I go to the Debug, the .Refresh BackgroundQuery:=False line below is what is highlighted as the problem, but I'm not savvy enough to troubleshoot this on my own.
When I ran the macro as recorded, it reproduced the correct results (see attached). Ultimately I need to run this for a large number of files, but don't need it to loop (yet).
Thanks for any help provided!
Bookmarks