web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to convert an e...
Power Automate
Unanswered

Trying to convert an excel to PDF

(0) ShareShare
ReportReport
Posted on by 16

Im trying to build a flow to convert a sheet in an excel file into a PDF s that a second flow can email it out as an attachment but im failing at the first hurdle. my flow to convert to PDF wont run.

 

Id already added a step to copy the file from sharepoint to one drive as i couldnt find a convert tool to do it direct from sharepoint.

 

My flow looks like this..

 

FayHudson_0-1633629235991.png

 

error message ...

 

FayHudson_1-1633629376958.png

 

FayHudson_2-1633629419840.png

 any ideas??

 

Categories:
I have the same question (1)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @FayHudson 

     

    xlsx to pdf is supported but based on my testing, I was able to recreate the error by running the conversion on an invalid xlsx file.  You mention that the file is copied from another location, have you manually tried opening the xlsx file on OneDrive?  My guess is that the create file action in your other flow isn't creating a valid xlsx as expected and you need to sort the original flow out for this flow to work 😉

     

    Please consider accepting my answer as a solution if it helps to solve your problem.

    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

  • FayHudson Profile Picture
    16 on at

    Thanks Damien, however the previous flow to create the xls file in one drive appears to be working so im not sure what is going wrong?

     

    The previous flow is as follows:

     

    FayHudson_0-1634157587556.png

    This flow successfully runs and i can see the xls file now in my one drive

    FayHudson_1-1634157717014.png

    Any ideas?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @FayHudson 

     

    Can you open the file on OneDrive? How basic or complicated are the contents of the file? 

     

    Damien

  • FayHudson Profile Picture
    16 on at

    Hi @DamoBird365 

     

    Now that you mention it, it is a spreadsheet with a number of sheets that contain tables feeding into a query.  Is that a problem?

     

    Ultimately im only copying to one drive because i cant find a convert to PDF straight from sharepoint (unless im missing something else that could help?!)

     

    I have a file in excel and each week i want to issue a PDF of one of the sheets out to a dist list

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    @FayHudson maybe?! Joys of testing and troubleshooting these things. I’ve just read over the docs https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content_format?view=odsp-graph-online and whilst there are known limitations, i can’t see anything about complex or multiple sheet workbooks. Can you try the routine on a simplified version of the workbook? Remove all but one sheet? 

    Using office scripts, it is possible to remove additional sheets but we need to discover if that’s the cause first.

     

    Damien

  • FayHudson Profile Picture
    16 on at

    it works with a simple excel file so is clearly an issue with the excel file itself!!  

     

    Thanks - but now still at a loss as to how i resolve

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Can you try it on the sheet that you want to save as pdf? If that works, I can give you a solution for stripping out the other sheets on your copy file.

     

    Damien

  • FayHudson Profile Picture
    16 on at

    Sorry @DamoBird365  Im not sure I understand what you mean, as in save a copy of the file i want to convert but with all the other sheets stripped out and then see if the conversion works?

     

    Thanks

    Fay

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @FayHudson 

     

    Exactly that. Yes.

  • FayHudson Profile Picture
    16 on at

    I have now got the flow to succeed and create the PDF - however the flow seems to run twice and the first time it succeeds and then creates a failed run as well? Not sure if this is important?

     

    The convert to PDF flow is as follows:

    FayHudson_0-1634203402519.png

     

    Im guessing now once ive copied the original file to one drive  i need to understand how to delete the other worksheets to enable the PDF creation to occur. Is it best to do that or simply only copy the relevant worksheet?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard