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 / Unable to save Excel w...
Power Automate
Answered

Unable to save Excel workbook after running macro

(0) ShareShare
ReportReport
Posted on by 60

Hi!

I have an excel sheet where I want to insert an object (PDF-file) - for this I created a macro which works fine (in terms om inserting the object as a pdf in the excel worksheet). However, when I'm about to save the file I get error message "Error where detected while saving... Excel may be able to save by removing or repairing..."
If I do these steps manually with PAD - insert - object - file - ok.. it works fine but I would rather speed up the process using the macro. Anyone has an idea? Also encountered same error message when I wanted to update a cube in excel (which was not related to a macro, just pressing refresh witch PAD made it impossible to save the file but doing manually worked fine).

Thanks!

I have the same question (0)
  • Verified answer
    kinuasa Profile Picture
    801 Most Valuable Professional on at

    Does the same error occur when the macro is executed from another book, as in the code below?

     

    Public Sub Sample()
     With Application.Workbooks.Open("C:\Test\Excel\AddOLEObject.xlsx")
     With .Worksheets.Add
     .OLEObjects.Add Filename:="C:\Test\PDF\TEST.pdf", Link:=False, DisplayAsIcon:=False
     End With
     .Save
     .Close
     End With
    End Sub
  • vp-pengu1n Profile Picture
    60 on at

    Thank you, seems to be working that way!

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard