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..
error message ...
any ideas??
Hi @FayHudson
One possible way to do this is to use the 2nd of two office scripts in this video https://youtu.be/4ZiMjjV1c3Q which allows you to delete sheets from an existing file.
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
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:
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?
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
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
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
@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
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
Hi @FayHudson
Can you open the file on OneDrive? How basic or complicated are the contents of the file?
Damien
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:
This flow successfully runs and i can see the xls file now in my one drive
Any ideas?
David_MA
140
Super User 2025 Season 1
Michael E. Gernaey
138
Super User 2025 Season 1
stampcoin
129