Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm receiving occasionally an xls file that contains a macro which I should use. If I don't have complete trust in the sender, I wish to look at the macro's source in order to verify that it indeed does only what it is supposed to.

However, in Excel 2010 the "edit" button under "view macros" is disabled unless I first enable macros for the sheet - but if I first enable macros then I can, at most, find out about malicious code only after that code has finished running...

How can I view the macro's source before enabling macros for the document?

share|improve this question
up vote 7 down vote accepted

You can have a look at all macros in a document by using the Developer tab in Word to give you easy access to the Visual Basic routines embedded in the document.

First you need to make sure that the Developer Tab is enabled. Go to File -> Options then:

developer tab

On the Developer Tab that should now appear there should now be a "Visual Basic" button which you can click to get to the Visual Basic editor.

Browsing through the document tree on the left of the editor you should be able see all the code and modules that are embedded in the document without first needing to enable macros.

I tend to do this with documents I do not trust.

Note: I've done this in Word, the same feature is available in Excel and the option to enable it is in the same place.

share|improve this answer

In all versions of all Office applications since 2003, and possibly earlier, Alt+F11 will open the VBA Editor. There is no need to enable the 'Developer' tab in the Ribbon for Office 2007 and newer for this to work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.