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 / 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
    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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard