Sunday, March 11, 2018

Working with Excel 4.0 macros

Working with Excel 4.0 macros

Although Microsoft Excel 2013 still supports Excel 4.0 (XLM) macros, we encourage you to migrate them to the latest version of Microsoft Visual Basic for Applications (VBA). Migrating your macros lets you take advantage of the improvements to the VBA programming object model. To make this easier for you, some new objects, methods, and properties have been added to the object model for the few remaining functions that did not have equivalents in earlier versions of VBA. In addition, performance improvements for Page Setup operations in VBA have been added to provide similar performance to PAGE.SETUP() functionality in XLM macros.

For more information about migrating your XLM macros, see Migrating Excel 4 Macros to VBA on the Excel product team blog.

If you decide you're not ready to migrate, you can still run Excel 4.0 macros. When you open an XLM macro in Excel 2010 with macros disabled, Excel displays the following message:

"Because of your security settings, macros have been disabled. To run macros, you need to reopen this workbook, and then choose to enable macros. For more information about enabling macros, click Help."

To change macro settings to allow you to run XLM macros, do the following:

  1. Click the File tab, and then click Options.

  2. Click Trust Center, and then click Trust Center Settings.

  3. Click Macro Settings, and then click Enable all macros (not recommended; potentially dangerous code can run).

    Important    We recommend that you do not use this setting or that if you do, that you return your macro security setting back to Disable all macros without notification as soon as possible.

  4. Click File Block Settings and then, under File Type, select Excel 4 MacroSheets and Add-in Files and make sure that the check box for Open is selected.

  5. Under Open behavior for selected file types, click Open selected file types in Protected View and allow editing.

  6. Click OK twice.

What next?

Download the Help file for Excel 4.0 macros to learn how to work with Excel 4.0 macros in later versions of Excel.

No comments:

Post a Comment