0

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

JD136
  • 113
  • 9
  • There doesn't seem to be a Microsoft REST API for this. You could use the Encodian API https://www.encodian.com/products/encodian-for-microsoft-power-automate/ and Convert the Excel file to PDF. – Ethan May 04 '21 at 20:55
  • When you say Excel Online, do you mean storing the file on cloud storage or on a filesystem on a computer/website online? What program will the consumer of the PDF be using? For example, will they use Adobe Reader, or will be like a URL that the open up from a browser? – Ed Mendez May 06 '21 at 01:57
  • @EdMendez I mean the file will be on cloud storage (at least I think so, basically it's Excel Online as accessible from One Drive). Basically, admin users would go into Excel Online, edit the file, then there would be a button that would link to a pdf version of the file (synced with the Excel Online file, of course). Ideally, the link would be a URL that would open up from a browser, though if it downloaded a copy of the PDF that users could then open in a PDF reader, that would work too. – JD136 May 07 '21 at 18:22

1 Answers1

0

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

Ed Mendez
  • 1,510
  • 10
  • 14
  • Hi Ed, this did work, albeit with many bugs, such that effectively it was not useable. Unfortunately, I don't think this is a viable route at this time, and I've let the end users know as such. Thank you for posting a suggestion! – JD136 Jul 12 '21 at 17:53