VBA & Macro Problems

Fix Excel Macro Not Working with AutoSave Before Manual Save

Rana GarciaRana Garcia Oct 13, 2026 869 views

Question details

A VBA macro designed to save a worksheet as a PDF and attach it to an email fails to run when opened without a manual save, despite AutoSave being enabled.

How to Fix Excel Macro Not Working with AutoSave Before a Manual Save
Product
Microsoft Excel
Device & OS
not provided
Scenario
Attempting to execute a VBA macro relying on the file's saved state while AutoSave is active.
Observed behavior
The macro fails to complete its tasks under AutoSave but functions correctly immediately after the user performs a manual save.
Before you start

Ensure you are running the Microsoft Excel desktop application, as VBA macros are not supported in Excel for the Web and will not run in a browser.

Solution 1Recommended

Verify Application Environment and Open in Desktop App

Confirm that the workbook is not being opened in Excel for the Web, which blocks VBA macro execution.

Many AutoSave issues tied to macros occur because files stored in OneDrive or SharePoint automatically open in the web browser by default. Excel for the Web cannot execute VBA code.

1
Check current application

Look at your application window. If you see a web browser interface (like Chrome or Edge), your workbook is open in Excel for the Web.

2
Launch desktop application

Click the 'Editing' or 'Viewing' button located on the top ribbon of Excel for the Web.

3
Open the file

Select 'Open in Desktop App' from the dropdown menu to launch the full Excel client on your computer.

4
Run the macro

Wait for the file to load, ensure AutoSave is toggled on in the top left corner, and attempt to run your PDF and email macro again.

Verify Application Environment and Open in Desktop App
Macro Security: You may need to click 'Enable Content' in the yellow security warning bar before the macro is allowed to run on the desktop application.
Free Microsoft Office alternative

Try WPS Office for Reliable Spreadsheet Management

If Microsoft Excel's AutoSave feature continues to interfere with your VBA workflows, consider switching to WPS Office. It provides strong compatibility with Microsoft Excel formats and offers a lightweight, intuitive environment for all your daily spreadsheet tasks.

  1. 1. Download WPS Office: Visit the official WPS website and download the free version of WPS Office.
  2. 2. Open your workbook: Launch WPS Spreadsheets and open your existing .xlsm or .xlsx file.
  3. 3. Manage your data: Enjoy seamless spreadsheet editing, formula calculation, and document formatting in a stable environment.
High compatibility with Microsoft Office formats, including .xlsm and .xlsxLightweight performance that runs smoothly without lagging your PCFamiliar user interface requiring zero learning curve for Excel usersFree to download and use for standard document and spreadsheet management
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro only work after a manual save?

When AutoSave is active, Excel constantly syncs changes to the cloud. Some VBA operations, like generating a PDF from the active sheet or fetching specific local file paths, might fail if the file is in a temporary syncing state. A manual save forces a local commit, stabilizing the file state for the script to run.

Can I run macro-enabled workbooks in a browser?

No, macro-enabled workbooks (.xlsm) cannot execute VBA scripts in Excel for the Web. While you can view the data online, you must open the file in the desktop version of Excel to run any embedded macros.

How do I share my macro code for further troubleshooting?

Open the VBA Editor by pressing Alt + F11, locate your module in the Project Explorer, copy the code text, and paste it into your support forum request. Be sure to also include your exact Excel version number and account type (e.g., Microsoft 365 Family or Enterprise).