Assistance Required - Converting an Excel Range Screenshot from Clipboard to an Image File in Power Automate Desktop

Abhijith A 0 Reputation points
2026-10-23T17:57:54.21+00:00
Hi,  
  
I have a requirement to capture a screenshot of a selected range of cells in Excel and then save the captured image, which is currently stored in the clipboard, as an image file (preferably PNG format) in a local folder using Power Automate Desktop.

Could anyone please advise on the best approach to achieve this in Power Automate Desktop? 
  
Thanks in Advance!

Microsoft 365 and Office | Development | Other

1 answer

Sort by: Oldest
  1. Kai-L 21,095 Reputation points Microsoft External Staff Moderator
    2026-10-23T19:16:42.2366667+00:00

    Dear Abhijith,

    From my research, Power Automate Desktop doesn't have a built in action to save an image from the clipboard. Its clipboard actions only get, set or clear text. One workaround is to have Excel export the range as a PNG through a macro, then call that macro from your flow.

    • Save the workbook as a macro enabled file (.xlsm). Press Alt + F11, go to Insert > Module and paste the macro below. Change the sheet name, range and file path as needed.
    Sub ExportRangeAsPNG()
        Dim ws As Worksheet, rng As Range, co As ChartObject
        Set ws = ThisWorkbook.Sheets("Sheet1")
        Set rng = ws.Range("A1:F20")
        rng.CopyPicture Appearance:=xlScreen, Format:=xlPicture
        Set co = ws.ChartObjects.Add(rng.Left, rng.Top, rng.Width, rng.Height)
        co.Chart.ChartArea.Select
        co.Chart.Paste
        co.Chart.Export "C:\Temp\RangeImage.png", "PNG"
        co.Delete
    End Sub
    
    • In Power Automate Desktop, use Launch Excel to open the workbook, then Run Excel macro with the macro name ExportRangeAsPNG, and finally Close Excel.

    If the exported image comes out blank, run the flow with Excel visible rather than hidden, because the picture copy needs the sheet to be displayed on screen. If the macro doesn't run at all, check that macros are allowed for the file, for example by saving it in a trusted location.

    If this doesn't work for your setup, I highly recommend reposting this in the Power Platform Community, specifically under the Power Automate forum. This dedicated community is a hub for automation experts. Beyond standard troubleshooting, the forum provides access to a vast repository of community-tested templates and deep-dive technical documentation that address complex issues. As you refine your workflow, participating in this forum is an excellent opportunity to develop your technical skills and learn from MVPs who solve these exact scenarios daily. 

    I hope this helps. Looking forward to your reply.


    If the answer is helpful, please click "Yes" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  

    Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.