Scenario: 2 departments, 1 macro for each:
Why is "-1" needed for one group of files and not the other? Because of Temporary files?:
File count accurate for Department 1 reports with:
fileCount = fso.GetFolder(myDir).Files.Count - 1
but for Department 2, I had to remove the -1
fileCount = fso.GetFolder(myDir).Files.Count
The code used to derive filepath is the same for each, just different paths are indicated in each macro, i.e.:
myDir = "C:\DATA\Department1\Sourcefiles"
myDir = "C:\DATA\Sourcefiles\Department2\"
Online source indicates fso only counts visible, not hidden files, using shell object so that should be a non-factor.
Even so, I tested on folders with no hidden objects for both Department 1 and 2 reports.
I also tested on a folder with a hidden thumb.db file for Department 1 reports.
Even when I change the number of files from 1 to 2 to 3 in the
Department 2 folder, it is only accurate w/o the -1 while Department 1
needs the -1.