Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 3 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
add comment

Your Answer

 
discard

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.