You are here

Count the number of pages in all PDF files in a library of documents in Windows File Explorer

Research articles : 

Overview of the spreadsheet

The spreadsheet available for download using the link above can be used to count the number of pages in numerous pdf documents contained within a library of documents in Windows. The spreadsheet has a macro that will look through all levels of subfolders when looking for pdf files, will skip over non pdf files, and will not change the content of the library in any way. The spreadsheet requires Adobe Standard or Adobe Pro to be installed, and if you do not have one of those then this spreadsheet will not work.

To use the spreadsheet, copy the path of the Windows folder that contains the library of pdf files to the clipboard, and then paste it into the yellow input cell in the spreadsheet. Click the green button, and the macro will produce a listing of the page counts of all pdf files in the library. This may be useful if you wish to charge someone for having printed to paper all of the pdf files in the library.

 

Security issues

The spreadsheet was developed using macros (programmed in visual basic) and in order for the spreadsheet to operate your security settings in Microsoft Excel must be set to allow macros to run.  To enable macros in Excel 2010 (similar procedures will apply in other versions of Excel) click:
  • File (i.e. the menu on the top left)
  • Options
  • Trust Centre
  • Trust Centre Settings
  • Macro settings
  • Enable all macros
 
Macros can pose a security risk because they make your computer perform certain steps automatically, but are typically only dangerous when made to be that way by a computer programmer with a malicious intention – hence the warning when you change the security settings in Excel. However, the macros available in the spreadsheet available for download on this page are made with good intentions and should not harm your computer.
 
Modern versions of Excel are very protective in shielding users from files with macros, and you may need to save the spreadsheet in a "trusted location" in order for the macros to run.
 
To designate the location the file is saved in as a trusted location, in Excel click:
  • File (i.e. the menu on the top left)
  • Options
  • Trust Centre
  • Trust Centre Settings
  • Trusted Locations
  • Add new location.
  • Copy and paste the path of the folder containing the spreadsheet in the dialog box to specify that folder as a trusted location. 

Users downloading and using this spreadsheet do so entirely at their own risk and agree to accept all risks associated with using the spreadsheet.