VBA & Macro Problems

How to Refresh Microsoft Forms SharePoint Excel Data with VBA

Tauseeq MagsiTauseeq Magsi Nov 10, 2026 868 views

Question details

The user needs a way to synchronize and refresh Microsoft Forms responses stored in a SharePoint Excel workbook using VBA, preventing the import of outdated or stale data.

How to Refresh Microsoft Forms SharePoint Excel Data with VBA
Product
Microsoft Excel
Device & OS
not provided
Scenario
Automating data import from a cloud-hosted Excel file that collects Microsoft Forms responses using local VBA macros.
Observed behavior
Local VBA macros read stale data because the SharePoint workbook does not automatically synchronize the latest Forms responses unless manually opened or triggered.
Before you start

Ensure you have the exact SharePoint URL for your Excel workbook and verify that your account has the necessary permissions to access files on SharePoint and create flows in Power Automate.

Solution 1Recommended

Use Power Automate to Trigger SharePoint Synchronization

Since local VBA cannot natively force cloud synchronization without opening the file, using Power Automate guarantees the Excel file retrieves the latest Forms data before running local macros.

A purely local VBA macro may fail to fetch the most recent Forms responses because the cloud-hosted Excel file has not yet synchronized. By setting up a Power Automate flow, you can simulate reading the file, forcing SharePoint to push the latest data to the workbook before your macro runs.

1
Create a new Power Automate Flow

Log in to Microsoft Power Automate and create a new automated cloud flow. Set the trigger to activate either on a scheduled basis or when a new Microsoft Forms response is submitted.

2
Add an Excel Online action

Add a step to read data, such as 'Get a row', targeting your specific Excel Online workbook stored in SharePoint. This action actively forces the cloud workbook to synchronize the latest form data.

3
Run your local VBA macro

Once the Power Automate flow has successfully run and synced the file, execute your local VBA macro. The macro will now pull the most up-to-date responses from SharePoint.

Use Power Automate to Trigger SharePoint Synchronization
Data Freshness Guaranteed: This method acts as a reliable bridge between cloud forms and local VBA environments, ensuring zero stale data is imported.
Free Microsoft Office alternative

Manage Your Spreadsheets and Macros with WPS Office

While cloud-syncing Microsoft Forms requires specific Microsoft 365 integrations, WPS Office provides a highly compatible, lightweight alternative for handling robust VBA macros, complex datasets, and daily spreadsheet tasks without the heavy subscription fees.

Fully compatible with Microsoft Excel (.xlsx, .xlsm, .csv) formats.Built-in support for VBA macros and advanced data processing.Free, lightweight, and fast to launch on Windows, macOS, and Linux.Familiar user interface ensuring seamless migration from Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my VBA macro read old data from SharePoint?

Local VBA scripts read the last saved state of the file. If SharePoint hasn't synchronized the latest Microsoft Forms responses into the cloud Excel file, VBA will pull the outdated, stale data.

Can I force SharePoint to sync using only VBA?

There is no purely built-in VBA method to silently force a SharePoint cloud sync without opening the file. You must either manually open the file in Excel Online first, use Power Automate, or use VBA to physically open the file from the SharePoint URL.

Will the ActiveWorkbook.RefreshAll command update my Forms data?

Yes, if the workbook is configured with proper data connections and you open the SharePoint file directly via VBA. Just be aware that Microsoft authentication prompts may pop up and require manual confirmation during the macro run.