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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problem: Convert Excel...
Power Automate
Unanswered

Problem: Convert Excel macro-enabled XLSM file to PDF

(0) ShareShare
ReportReport
Posted on by 123

I have a Excel macro file (workbook) which requires to be uploaded to OneDrive for Business and converted to PDF. Trigger is When a file is created. Then using standard Convert File action (PDF format) and then Create File which does not give any error. However, the created PDF file has 0 bytes and does not open as a PDF in browser or Acrobat Reader. 

I have also tried to save the file as XLSX (non-macro) file, but same result. 

One reason for the problem may be that the file has multiple worksheets (about 15). I have defined a Print Area in the Excel. Also, I have a Name Range defined for the area I want to print. Not sure what will help.

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @YatinMumbai ,

     

    Have you tried using Get file content action or Get file metadata to get the file size and File content?

     

    See if its file contents can be referenced normally and if the file size is as expected.

     

    In addition, you can create a simple Excel file to perform a similar test and see if such errors also exist. The purpose of this is to confirm whether this is related to the reason for the problem you mentioned.

     

    Best Regards,

  • YatinMumbai Profile Picture
    123 on at

    UPDATE: 

    After a of tinkering I found the issues that prevent Excel to PDF conversions (using OneDrive Convert File action). 

    1. Remove all of the the following - Macros, Modules, Buttons.
    2. Remove all Connections. In 2 worksheets I had a table linked to a SharePoint list causing fail.
    3. Both of the above can be done from VBA code (in Save As macro).
    4. Save the file as XLSX file. (FileFormat:=51)

    Issue still present:

    1. You cannot select a single worksheet to print.
    2. It is better to have created Print Area for each worksheet since all worksheets will printed to PDF.
    3. If your sheets are a mix of Print Area as portrait and landscape orientation, the conversion will have only the orientation of the first sheet. All other orientation settings will be ignored. If you use a third party PDF converter like Muhimbi, this is taken care of.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 112 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 52

#3
Ellis Karim Profile Picture

Ellis Karim 51 Super User 2026 Season 1

Last 30 days Overall leaderboard