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

Failed to save Excel document

(0) ShareShare
ReportReport
Posted on by 69

I'm trying to write a value into a cell and then save the Excel file everytime something is completed, I tested on another Desktop Flow and is working, but I'm trying to do it in my main flow and is giving me this error. Could you help me with this? It doesn't have sense that this works:
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: PEOIDPath Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: $'''No''' Column: $'''C''' Row: 2
Excel.CloseExcel.CloseAndSave Instance: ExcelInstance

but this no:
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: PEOIDPath Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''Sheet1'''
Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
Text.ToNumber Text: CounterDone Number=> CounterDone
Excel.ReadFromExcel.ReadCells Instance: ExcelInstance StartColumn: $'''A''' StartRow: CounterDone + 2 EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText: False FirstLineIsHeader: False RangeValue=> PEOIDList
Excel.CloseExcel.CloseAndSave Instance: ExcelInstance




Correlation Id: cfdb83db-83dd-4de1-ad78-b8b983b81ef1

Can't save 'PEOID.xlsx' because the file is read-only.: Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Failed to save Excel document 'PEOID.xlsx'. ---> System.Exception: Can't save 'PEOID.xlsx' because the file is read-only.
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.SaveExcelInstance(Object activeWorkbook, String workbookName, FileVariant documentPathSafe, SaveExcelEnum saveSafe, ExcelSaveAsFormatEnum saveAsFormatSafe, String xmlMapName)
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.CloseExcel(Variant excelInstance, Variant documentPath, Int32 save, Int32 saveAsFormat, String xmlMapName)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.CloseExcel.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

image.png
  • Verified answer
    LuisAznar Profile Picture
    69 on at

    I found the solution by myself, don't know if this could be happening to you, but previous to open ExcelInstance I was opening SQL Connection and forgot to close it. Before launching instance, is mandatory to edit Excel File to close all previous connections that interact with the file and its instance.

    LuisAznar_0-1710780961760.png

     

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
11manish Profile Picture

11manish 237 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 194

Last 30 days Overall leaderboard