How to open an Excel Online document as a PDF

79 Views Asked by At

We have an Excel Online file that I'd like to link to, but as a pdf. In other words, I want a link that opens the contents of the Excel Online file as a PDF file. Ideally, admin users would be able to edit the excel file, then end-users would be able to open the PDF version of that file, as it is continuously updated by the admin users. Is this possible? I would need a link to the PDF version of the file.

I did come across this thread, but the answer isn't actually answering the question. https://superuser.com/questions/1133384/is-it-possible-to-link-or-sync-an-excel-spreadsheet-with-a-pdf

1

There are 1 best solutions below

1
On

Based on your response above I believe the following may accomplish what you want.

What you will need to do is enable the Developer Tab in Excel so we can create Macros. We will be creating a Macro that will Save the excel file as a PDF. My assumption is that there is one worksheet in the excel file. When you enable the macros, and save the first time it you will need to save it as a xlsm file to save the macros with the file. Once you do this perform the following below.

  • In Onedrive create a new folder and call it "MyPubDocs" for example.

  • In Excel open up your online Xlsm file and do a SaveAs

  • In the file dialog Box navigate to the Onedrive folder you created and take note of the folder name. It might show...

  • In Excel go to the developer Tab, if you don't see then go to File Menu -> Options -> Customize RIbbons -> Popular Commands (left) and Main Tabs (right) and check the Developer checkbox. click OK.

  • Click on Macro Button Set the Macro name to "SaveToOneDrive" ad click create.

  • That should open a IDE where you will paste the following command.

    ActiveWorkbook.SaveAs Filename:="https://d.docs.live.net/XXXXXXXXXXXXXX/MyPubDocs/" & "MyExcelFileExportAsPDF.Pdf"

  • When creating the macro you should be able to assign a hotkey to that macro.

  • Now whenever the admin finishes saving the excel file, they can press the hotkey or run the macro and it will save the file to the location.

  • If you want to associate the macro to the save event of the workbook, you can, but auto save should be turned off.

  • After the first time you saved the pdf, go to onedirve and navigate to the pdf file. Create a sharable link that you can distribute to your users. When they navigate to that sharable link it should show them the most recent pdf.

HTH