Excel tutorials

How to see the source code for VBA macros if access to the VBE is password protected

I believe that some Excel users would like to hide their own VBA macros that they put in a VBE for a workbook. Simply, they wanted to protect their own work and prevent users from seeing and copying the VBA macros.
Which is the reason I will not enter it, but I think that should be respected desire author workbooks and do not need to hack VBE in Excel, to see the VBA macros command or copy it for other own needs. I've seen enough questions on various forums where people want to hack access to VBE to see the VBA macro. No need to hack.

Microsoft developers have enabled you to easily access the VBA code that is located in VBE with some workbooks that have protection for access to VBE. (Are the MS developers accidentally made a mistake or possible 'BUG', it will leave the MS developers think).

Also, if you would like to hide a password-protected worksheet that the user does not even know that the hidden workbook exists and you think that's done well, I think you're wrong. About this problem of a 'very hidden worksheet' that is password-protected (a possible MS developer mistake or Excel BUG) I have already written on this forum. But a satisfactory answer to the right solution I did not get.

In the picture below, note that 'Sheet3' is available to the user to know that it exists in the workbook. What purpose then hide worksheet (is this a bug, assess you own?).

I saved my workbook and reopened it. When I click the File command in the yellow field, notice that the user finds that there is a 'Sheet3' in this workbook that he does not currently see this worksheet is not available for viewing because "xlSheetveryHiden" is set.

Why we see there is a very hidden, password-protected Sheet within the Workbook

Look at the very hidden workbook in Excel is this BUG?

Let's go further, the basic purpose of this tutorial is different in nature. Take the next situation.

I've created a workbook (example.xlsm) that consists of three worksheets (Sheet1, Shet2, Sheet3). Accessing the VBE in these worksbook, I have password protected (I want to hide the view of the VBA macros found on 'Sheet1' and 'Sheet2').

An example of a workbook from this tutorial

How to View VBA Source Code in Protected VBA project in Excel

Sheet1:
This worksheet 'Sheet1' contains data
This worksheet 'Sheet1' is password protected
This worksheet 'Sheet1' contains a VBA macro

Sheet2:
This worksheet 'Sheet2' contains data
This worksheet 'Sheet2' is not password protected, This macro I want to hide from view users
This worksheet 'Sheet2' contains a VBA macro
This worksheet 'Sheet2' is hidden

Sheet3:
This worksheet 'Sheet3' contains data
This worksheet 'Sheet3' is password protected, This macro I want to hide from view users
This worksheet 'Sheet3' is very hidden

Available View of Source Code Protected VBA Macros, BUG or Not?

Workbook is completed. I'm sending it to the user. For a few days, the user asks me what he looks like at the VBA macros found on 'Sheet1' because he wants to notice it on some of his own projects. I do not want to say it :)
Of course, the user is persistent and surfing the internet finds a way to get the source code of the VBA macros.

Simply, the user has copied 'Sheet1' into a new open workbook. In the new workbook is access in the VBE and then, he can see the source VBA macro.

Is there a way to prevent a user from looking at the source VBA macros if you are protecting access to VBE Excel, leaving you in research and MS developers.

And at the end of this tutorial, by clicking the Download link, you can save on your computer the workbook I was doing this tutorial.
Try to find out what the VBA macro is located on 'Sheet1'.