Get Error as "Can't reach this Page" Make sure the web address http://%22c is correct When Opening PDF in MS-Edge

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
Hi
I am trying to open a PDF File through MS-Edge to see a particular Page but unfortunately the below code opens the Internet Explorer and I Get Error
Get Error as "Can't reach this Page"
Make sure the web address http://%22c is correct


Anyways for syntax needs to be corrected to Open PDF in MS-Edge rather than Opening in Internet Explorer and then to display Correct Page Kindly guide me
VBA Code:
Private Sub UserForm_Initialize()

Dim myLink As String
Dim mypage As Long
Dim objEdge As New InternetExplorer 

TextBox1.Text = "C:\123\ABC.pdf"
myLink = Chr(34) & TextBox1.Text & Chr(34)
mypage = InputBox("Enter the page number")

With objEdge   
.Navigate myLink & "Page No." & mypage
.Visible = True
End With
End Sub
NimishK
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi,​
as a reminder your code can't be for Edge but for IE only …​
 
Upvote 0
Hi,

as a reminder your code can't be for Edge but for IE only …
MarcL

Are you telling me even for Edge i have to use the same syntax which i did as Internet Explorer. If yes then can you help me get rid out of Error
and help me to show the particular Page of PDF File

Thanks
NimishK
 
Upvote 0
When you open the pdf file under Internet Explorer and go to the desired page : is there something relative to the page number in the URL ?​
 
Upvote 0
When you open the pdf file under Internet Explorer and go to the desired page :

As per the coding in #1 when putting the Page number in Inputbox, Page No of that PDF file should open.
I dont know niether whether correct coding to open the Pg number is right or wrong

is there something relative to the page number in the URL ?
Nor i don't understand your above statement ? What should be relative to Page number and Why URL

Do i need add URL syntax in the above code ? if yes then how

FYI I am working on PDF via VBA for the First time

NimishK
 
Upvote 0
Hi

I got some kind of success but only able to open PDF but without that Page number.
if you can guide me how to add Page number


VBA Code:
Private Sub UserForm_Initialize()

Dim myLink As String
Dim mypage As Long
Dim objEdge As New InternetExplorer 

TextBox1.Text = "C:\123\ABC.pdf"
myLink =  TextBox1.Text  
mypage = InputBox("Enter the page number")

ActiveWorkbook.FollowHyperlink myLink & "#Page=" & mypage


End Sub
NimishK
 
Upvote 0
Without any answer to my question so I just can say it seems not possible to open the pdf file directly on a specific page …​
 
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top