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 / PAD Flow works but whe...
Power Automate
Answered

PAD Flow works but when called from the Cloud I receive error 'Failed to Save Excel Document'

(0) ShareShare
ReportReport
Posted on by 64

Greetings!

I have created a desktop flow that runs a sql query and outputs data into an excel spreadsheet and saves it to my onedrive, without any issues. However, when I try to run the flow from the cloud, I receive the following error:

 

MCubedMama_0-1699984249534.png

This is my Cloud Flow: 

MCubedMama_1-1699984284573.png

 

This is the rest of the error message: 

Problem while executing action 'CloseAndSaveAs'. Failed to save Excel document ''.

Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Failed to save Excel document ''. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The file could not be accessed. Try one of the following:

• Make sure the specified folder exists.
• Make sure the folder that contains the file is not read-only.
• Make sure the filename and folder path do not contain any of the following characters: < > ? [ ] : | or *
• Make sure the filename and folder path do not contain more than 218 characters.
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.Flow.RPA.Desktop.Modules.Excel.Actions.ExcelActions.InvokeMethod(Object o, String methodName, Object[] methodArgs)
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)

I have the same question (0)
  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @MCubedMama 

     

    After saving the file into Onedrive, how you are opening that file? Also, check if you are opening the excel file as Read-only or normal, Are you running this as Attended / Unattended.

    Is the file is available in the correct location?

     

    It would be great if you can share your desktop flow screenshot and expanded cloud flow as well

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Regards,

    Srini

     

  • MCubedMama Profile Picture
    64 on at

    Hi @Srini007

    Thank you for your reply. 

    Here is a view of my PAD Flow for when I export data from SQL query to excel: 

    MCubedMama_2-1699991574943.png

     

    Here is my Cloud Flow: 

    MCubedMama_1-1699991361488.png

     

  • Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @MCubedMama 

     

    You are passing the File Path to save the excel file, can you check / try hardcode the value and check if that is running fine?

     

    Also check below option is disabled

     

    Srini007_0-1699992077071.png

     

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Regards,

    Srini

  • MCubedMama Profile Picture
    64 on at

    @Srini 

    I just tried that and it did not work. Thank you for that suggestion through.

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    I would recommend saving the file locally first and then using Move file(s) to move it to the OneDrive directory, or using the OneDrive connector for creating a file there. This is because the sync done by the OneDrive app can cause issues when writing to it via PAD.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Verified answer
    Srini007 Profile Picture
    3,490 Super User 2026 Season 1 on at

    Hi @MCubedMama 

     

    This might be the problem as your machine is synced with the Onedrive, suggest you to create the file in D drive and then move that file to Onedrive

     

    Also, check the suggestion from @Agnius as well

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Regards,

    Srini

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 298 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 150 Super User 2026 Season 2

Last 30 days Overall leaderboard