cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
zesamsam Advocate I
Advocate I

Update macro-enabled Excel file?

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? 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Update macro-enabled Excel file?

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

 

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Community Support
Community Support

Re: Update macro-enabled Excel file?

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

 

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

zesamsam Advocate I
Advocate I

Re: Update macro-enabled Excel file?

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! 🙂 

chrisody1
New Member

Re: Update macro-enabled Excel file?

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

chrisody1
New Member

Re: Update macro-enabled Excel file?

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

Shaffy80
Regular Visitor

Re: Update macro-enabled Excel file?

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 Advocate II
Advocate II

Re: Update macro-enabled Excel file?

@Shaffy80  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

 

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,439)