Putting the file & folder name in variables makes the code much easier to read by separating out the cluttered names away from the code. It also allows you to use the variables in multiple locations without having to spell them out each time. Thereafter, if you change the file or folder name, you only have to do it in one place.
Putting the file & folder name in separate variables allows you to use them separately (as in the example).
In fact, I seldom put folder & file names in my code. I prefer to put them in named cells so they can be maintained by users without needing to update the code. This also makes testing (with test file names and folders) and production distribution easier.
To do that the code would be:
Just remember to include the final "/" in the folder name, or put code in to check for it and add it if needed.
Bookmarks