Automatically Open Specific Page in PDF Document Using Excel VBA

Many viewers wanted to know how to automatically open a specific page in a PDF document using Excel VBA. Watch the training video below before you study the complete VBA code and download the attached sample file:


Watch the video on YouTube.


Download a sample Excel file:


Complete VBA code for automatically opening a specific page number in a PDF document in Excel:
Sub openPDFPage()
Dim myLink As String
Dim myPage As Long
Dim objIE As New InternetExplorer

‘myLink = “C:\files-from-excelvbaonline\excel_vba_programming_for_dummies_3rd_edition.pdf”
myLink = “http://www.excelvbatutor.com/vba_book/vbabook_ed2.pdf”

myPage = InputBox(“Enter the page number”)

With objIE
.Navigate myLink & “#page=” & myPage
.Visible = True
End With
End Sub