web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update macro-enabled E...
Power Automate
Unanswered

Update macro-enabled Excel file?

(0) ShareShare
ReportReport
Posted on by 8

Hello folks, 

 

I'm trying to build a calendar for my team, where everyone would update a shared Excel file with Flows and specific meeting categories for holiday, training and travel.The data I get in such a way would then be compiled via a VBA macro to get a matrix view of everyone's availability. 

 

I have an annoyance and a double problem:

  • The annoyance is that I can't seem to be able to directly update a shared Excel file on a team sharepoint site via Flow. Instead, I worked around this by having two Flows: one for updating the file on my OneDrive, and then another for copying the changes to the shared file on the team SharePoint
  • The double problem is that Flow doesn't seem to be able to handle .xlsm files. I can't update the macro file via the first Flow, since it is not considered "an Excel file", and when I try to update it via the second Flow, the file gets corrupted. 

Anyone has any idea that might help me here? 🙂 

Categories:
I have the same question (0)
  • Verified answer
    v-monli-msft Profile Picture
    on at

    Hi @zesamsam,

     

    It is true that you cannot directly only add/update some rows to excel files that stored in SharePoint libraries. But we do have the action to update the whole file content in sharepoint library. I'm guessing that you are using the below action in the second flow to copy all the updates to the library:

    捕获.JPG

     

    In this action we could get the .xlsm file. But with the Excel-Insert row action, the .xlsm file cannot be found and recognized by flow. And I think this is what you mean by "I can't update the macro file via the first Flow". It seems that this file type cannot be identified by Excel action in flow so far. If you really need this, please consider to post an idea for this requirement so that others can vote on it.

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    Regards,

    Mona

     

     

     

  • zesamsam Profile Picture
    8 on at

    Hello, 

     

    That is exactly what I did, but updating the .xlsm file in such a way corrupts it. 

     

    I have worked a temporary workaround where I update an Excel file on an O365 Team site, I synchronise the file with OneDrive for Business, and I get the data imported via macro in my macro-enabled file, but that's a real hassle and not what I would expect from automation of tasks 🙂 

     

    I have created an Idea as suggested, hoping something is done for that. Thanks! 🙂 

  • Community Power Platform Member Profile Picture
    on at

    hellow can you show a pic of your work around/ it would be most appreciated because im im having similar problem

  • Community Power Platform Member Profile Picture
    on at

    o


    @zesamsam wrote:

    Hello folks, 

     

    I'm trying to build a calendar for my team, where everyone would update a shared Excel file with Flows and specific meeting categories for holiday, training and travel.The data I get in such a way would then be compiled via a VBA macro to get a matrix view of everyone's availability. 

     

    I have an annoyance and a double problem:

    • The annoyance is that I can't seem to be able to directly update a shared Excel file on a team sharepoint site via Flow. Instead, I worked around this by having two Flows: one for updating the file on my OneDrive, and then another for copying the changes to the shared file on the team SharePoint
    • The double problem is that Flow doesn't seem to be able to handle .xlsm files. I can't update the macro file via the first Flow, since it is not considered "an Excel file", and when I try to update it via the second Flow, the file gets corrupted. 

    Anyone has any idea that might help me here? 🙂 


    hey can you post a pi of your work around, would be extremly useful

  • Community Power Platform Member Profile Picture
    on at

    Hi You can use Power Shell to Automate the Above , below is the workaround

     

    Step 1

    In the Macro Enabled Excel Sheet Add another Macro to Save the File as 

    ActiveWorkbook.SaveAs Filename:= _
    "filename" _
    , FileFormat:=xlOpenXMLWorkbook, CreateBackup:=True

     

    This will save the file as a Non Macro Excel File on a Sharepoint or Onedrive Site

     

    Step 2

     

    Use a Power Shell Query to update the Macro enable Excel file and save on 

     

    Step 3

     

    Use task scheduler to repeate the above process as per your required interval (Hourly/daily/Monthly etc)

     

     

    Once the 3 steps are completed the your workbook is completely automated and can be connected to flow as any other excel file.

     

    Thanks.

  • Charles-v-D Profile Picture
    280 on at

    @Anonymous  Would you please elaborate on this? 

     

    I have following in place:

    1. I have a excel sheet called DataAnalysis.xlsm where a macro takes care of data processing for me.
    2. The macro ends with the result data being written into a excel table
    3. I have a powerapps app that dislays the data on a mobile app to my staff

    I would like to have step 1 to be automatically executed via a MS Flow. It seems that you have found a workaround to have this done. Would you please elaborate.. I don't understand the mechanism of the steps... some screenshots would be appriciated!

     

    Regards

    charles

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard