Excel VBA to return Page Count from protected PDF file
问题 I need to retrieve the number of pages in PDF files (with security ), using Excel VBA. The following code works when there is no security enabled in the PDF file: Sub PDFandNumPages() Dim Folder As Object Dim file As Object Dim fso As Object Dim iExtLen As Integer, iRow As Integer Dim sFolder As String, sExt As String Dim sPDFName As String sExt = "pdf" iExtLen = Len(sExt) iRow = 1 ' Must have a '\' at the end of path sFolder = "C:\test\" Set fso = CreateObject("Scripting.FileSystemObject")