How do I open a PDF in Excel macro?
I found a macro to open any file on a computer by default, but it only opens a text document.
How do I change it to open a PDF instead? This was written by Matt.
Sub openPDF(). 'On Error Resume Next. Dim vName As Variant, pFile As Object, d As Date. On Error GoTo OpenError. vName = Application.GetOpenFilename("All Files (*OpenTextFile(vName, ForReading) d = DateAdd("d", 30, Now). pFile.WriteLine ("File was opened from:" & d) OpenExit: If Err <> 0 Then MsgBox "You chose not to open the file " & vName & " (" & Err & ")". Application.EnableEvents = True Exit Sub. OpenError: MsgBox Err.Description Resume OpenExit. End Sub. The code you used is going to look for *txt files only, because "All Files (*)" will contain filenames beginning with an extension (eg xxx.pdf). You could add ".pdf" to your list of filenames (eg "All Files (*)", "All Files (*),pdf").
Also, I prefer not to use On Error Resume Next. I would use Sub openPDF(). '.GetOpenFilename("All Files (*pdf",, "Please select a file to open") .
BTW, if you want to get the time of opening the file, you should also add the line
How do I open a PDF directly from edge?
Is there any setting on edge (the website) or the default pdf-reader that opens a PDF file and starts reading it? I do not want to install add-ons or other software. I have some legal agreements that I need to read from pdf in order to verify them. And is it possible to have a button, for example, that takes a link to a PDF from someone else and opens it as if it was on the site? Go to the top right menu of Edge browser(in my case) and click on "Show Desktop". Then Open your PDF file from your file manager and drag and drop the .pdf file on to the edge browser. You will find that a pop-up will appear that enables you to open/read the PDF document.
Why are my PDF not opening in Microsoft Edge?
I've been trying to figure out why some PDFs on our website aren't opening in Microsoft Edge.
The link is There are a few other links that don't open correctly on Microsoft Edge, but they're all from a different website and it's not the same issue.
This site uses a Flash embed to display its content. You can view the embedded Flash content in Internet Explorer and Chrome but not in Edge (it has a missing content error). I believe the error is in the underlying SWF file.
If you download the SWF and then download and install Adobe Flash Player from here you should be able to view the embedded Flash content in Edge.
Related Answers
Is there a free program to convert PDF to Excel?
I've seen a few programs that are supposed to be able to c...
How can I open a PDF file in Excel for free?
How to Convert PDF to Excel for Free. Convert PDF to Exce...
How do I download a non downloadable PDF from a website?
How to download a PDF from Google Chrome on Windows. There are...