Apr 03 2024 07:41 AM - edited Apr 03 2024 07:42 AM
I have created an Excel workbook in Sharepoint with PivotTables with a PowerBI connection (a Lakehouse in Fabric). Since the data itself gets updated monthly, I'd like a copy of the Excel without the connections in Sharepoint - so a non-refreshing copy of the Excel.
I found that deleting the connections is only possible in the app. I want to do it entirely online because I'd like to automate the copying file and deleting connection process. I know auto-deleting connections is possible with a VBA script but I believe those cannot run in Sharepoint unless someone opens the file in the app. I'd like the connections deleted before the file is even opened by anyone in the app - preferably after the copy is created. Or if this is possible through VBA in Sharepoint and I can automate it, I'd like to hear it :)!
One thing I've researched is Office Scripts, which seems to be Javascript-like code. Is creating an Office Script to delete connections entirely online possible in the first place (since I cannot manually delete them online)?
Thank you!
Apr 03 2024 09:25 AM
Directly deleting data connections in Excel Online (SharePoint) without opening the file in the Excel app or using VBA scripts isn't supported…so far I know at the time. However, you can consider a workaround using Microsoft Power Automate (formerly known as Microsoft Flow) to achieve a similar result.
Here's a high-level approach:
Regarding Office Scripts, while they allow you to automate tasks in Excel Online, they have limitations compared to VBA, and currently, there isn't direct support for manipulating data connections. However, you can explore if there are any new updates or features added to Office Scripts that might support your requirement.
Keep in mind that Microsoft regularly updates its products and services, so it's always a good idea to check the latest documentation and announcements for any new features or improvements that might align with your needs. The text, steps and formulas was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.
Apr 03 2024 09:36 AM
To my knowledge we can't remove connection with Office Script. All workbook methods are here ExcelScript.Workbook interface - Office Scripts | Microsoft Learn
Apr 03 2024 09:38 AM
Could you please clarify how this option
"Send an HTTP request to SharePoint" action to update the metadata of the copied file, which could include removing the data connections.
exactly works
Apr 03 2024 09:57 AM