Opening PDFs

sassriverrat

Well-known Member
Joined
Oct 4, 2018
Messages
655
Trying to open a pdf using excel 2010.

I get the "trusted" window which I click yes to, and then nothing. Adobe has always worked fine on this machine. I'd be happy opening with Google Chrome if that was more effective....

Code:
Sub Opener()Dim tstamp As String
Dim Namer As String
Dim pdf As String
With Sheets("Background")
    Namer = .Range("B4")
End With
On Error Resume Next
pdf = Environ("Userprofile") & "\Documents\" & tstamp & "\" & Namer & ".pdf"
ActiveWorkbook.FollowHyperlink pdf
End Sub
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I’m not sure I follow. J was going to read that piece today when I get s bit of time....but I’ve not see the follow hyperlink piece not work before...
 
Upvote 0
What about : ActiveWorkbook.FollowHyperlink Address:=strPDFFile, NewWindow:=True

HTH
 
Upvote 0
Sorry for the delay @James006, I just had a chance to get to it and run it. It worked! So out of curiosity, what would allow it to work here and not elsewhere?
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

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