Excel tutorials

How to use a Workbook that contains VBA macros if it is prohibited to run macros

In this Excel tutorial I will show how we can use Excel workbooks that contain VBA macros, although Excel settings do not allow run of VBA macros. I believe you know how to perform VBA macros.

However, there are situations where users can not set the allowed execution of VBA macros on a computer they use (whether it is not allowed by the system administrator or the responsible person related to the security of computers and computer networks). I will here describe the situation when we can use a workbook containing VBA macros without compromising the security of the computer and the Windows operating system. The image below shows how you can disable the execution of the VBA macros in Excel.

Disable VBA macros in Excel


The file format (extension) that contains VBA macros can be .XLS and .XLSM (.XLSB). Excel 2007 and later use *.xlsm file format that contains VBA macros. A file that has the .XLSX format can not contain VBA macros and is safer for using the Excel workbook. This separation developers to Microsoft's somewhat prevented eventual possible damage caused by a computer running the file that has an extension *.xlsm. I believe you know that VBA macros can compromise the security of your computer. Therefore, it is not good to run Excel XLSM workbook format from unverified and unreliable sources. There are some "safe" options to open an Excel .xlsm file with pressing and holding the SHIFT key before starting the file, but I will not write about this in the tutorial.

However, to use Excel Workbook that have the .XLSM format you can do the following:

  1. Open a new Excel Workbook and click File -> Options
  2. In the 'Excel Options' dialog box, click 'Trust Center'

Add a trusted location in Excel - Trust Center in Excel

How to Add a New Trusted Location in Excel

3. In the 'Trust Center' dialog box, click the 'Trusted Locations' option, the arrow marked with the number 1. See the image below. Further, click on the (2) 'Add new location' button to find the location you trust.

Reliable location in Excel that I trust

4. In the new dialog box (the picture below), click the Browse button (2a) to find the folder you believe will contain the verified Excel workbooks that contain VBA macros. Make sure to check the box 'Subfolders of this location are also trusted', as this means that if you create a new folder within the 'Top Folder', you also believe it. Click OK button. You have now set up a trusted location that you trust (a picture above the arrows marked with number 3).

Add a new trusted location in Excel

Of course, in this folder you can copy the .xls, .xlsx, xlsm, xlsb files that you get from the trusted sources and from the people you trust. Attention! Watch who you trust when you get and run the .XLSM file format!