If you’re doing it in a loop and the base URL is always the same, just change the source URL string to incorporate the change rather than using ReplaceAll to save cycles.
Actually, I complete the URL with an iIndex value as 4 digits (loop indice) + “.pdf”.
The space replace with %20 is done only once before the loop.
I fact, I put the code in the created the project and removed the loop, all the useless there comments, etc.
I even could pass the whole URL (for the shared example) instead of a build one, but wth bad vision, I concentrate to avoid errors.
Now, I have to guess for other months (the shared base url is valid for January 1946. (If you are curious, check pdf index 141 for the article about Japs attack on Pearl Harbour: the title of the article is “Navy Intelligence Officer Forecast Pearl Harbor Attack Nine Months Before Jap Raid Was Launched”).
Just glad I could help you make progress. Don’t forget to mark the solution so that others can easily find the answer should they encounter a similar issue in the future.