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 / Save spreadsheets as PDFs
Power Automate
Answered

Save spreadsheets as PDFs

(0) ShareShare
ReportReport
Posted on by 5

As Power Automate goes through each iteration of a loop, I would like the resulting updated spreadsheet saved as a PDF.

  • Verified answer
    VJR Profile Picture
    7,635 on at

    Hi @MarkTheirl 

     

    This is possible but by using an Excel VBA macro that will open your Excel and save sheets as individual PDFs. Then call this macro from PAD.

     

    Or you can write a vbscript, and then in PAD use "Run a vbscript" action.

     

    You will find tons of code on the web regarding the same.

     

    Here is a Vbscript to save individual sheets as separate PDFs.

    Put the below in Run Vbscript action and change the path variables.

     

    Dim objExcel, objWorkbook, ExcelFilePath, PathToSave 
    
    
    ExcelFilePath = "C:\Test\Source Excel.xlsx"
    PathToSave = "C:\Test\"
    
    
    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open (ExcelFilePath,True)
    
    
    For i = 1 To objWorkbook.Sheets.Count
    	set ws = objWorkbook.Sheets(i)
    	ws.ExportAsFixedFormat xlTypePDF, PathToSave & ws.Name & ".pdf"
     Next
    
    objWorkbook.close

     

     

    You would need to add extra code if you need to:

    - Add print margins, set print area, etc

    - Exit the excel application

    - Use PAD variables inside of the vbscript

     

  • MarkTheirl Profile Picture
    5 on at

    Now I know why you are a Super User!

    Thanks,

    Mark

  • VJR Profile Picture
    7,635 on at

    Lol.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard