Protect your Macro's?

railguage48

New Member
Joined
Dec 8, 2012
Messages
11
I am using excel 2007.

Is there a way to ensure that when you send an excel spreadsheet to someone else that you can ensure that they cannot see any of your macros?

The problem is that when I open an excel spreadsheet and goto my developer tab and then click on macros a whole list of macros show up.
The question above is to try and make sure that this list does not show up and I also hope that it prevents anyone from editing my macros?

Thanks.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I am using excel 2007.

Is there a way to ensure that when you send an excel spreadsheet to someone else that you can ensure that they cannot see any of your macros?

The problem is that when I open an excel spreadsheet and goto my developer tab and then click on macros a whole list of macros show up.
The question above is to try and make sure that this list does not show up and I also hope that it prevents anyone from editing my macros?

Thanks.

Welcome to the forums!

Go into the VBA Editor, and right-click on the VBAProject you want to protect. Choose "VBAProject Properties", and go to the "Protection" tab. Tick the box "Lock project for viewing", and assign a password that must be entered in order to view the VBAProject.

Hope that helps!
 
Upvote 0
Welcome to the forums!

Go into the VBA Editor, and right-click on the VBAProject you want to protect. Choose "VBAProject Properties", and go to the "Protection" tab. Tick the box "Lock project for viewing", and assign a password that must be entered in order to view the VBAProject.

Hope that helps!

Thanks for your help MrKowz,

I opened an new spreadsheet and navigated to the Developer tab where I clicked on the Visual Basic icon. Once there I right clicked the VBAProject(Personal.xlsb) project and activated the "Lock project for viewing" box and then password protected it.

Then .... I closed and saved changes and opened a new excel file and navigated to the Developer tab and double clicked the macros option and alas all the macors are still listed.

I must be doing something wrong?

Any suggestions?

Thanks.
 
Upvote 0
So you're wanting to password protect your Personal.xlsb from being viewed by others?
 
Upvote 0
Yes ... I have all of my macros in Personal.xlsb and so when I sent my spreadsheet with some work that I had done for another fella, he sent it back to me with some additional request and so I modified things and subsequently sent those back to him.

Well the next time I ran a macro for a totally different task ... it did not work as it used to so I went into the macro and after some investigation I noticed that one paramater had been changed.

I then realized that all of my macros went along with the spreadsheet and that anyone could edit etc the macro's.

So ... my apologies for the long story ... but that is why I want to make sure they cannot be viewed or edited or corrupted.

Thanks.
 
Upvote 0
That's strange. Personal.xlsb doesn't attach itself to anything. My apologies for asking these basic questions, but are you sure that all of your macros from your personal.xlsb got attached to the spreadsheet you sent? Did your personal.xlsb, itself, get changed; or did the macros embedded in the spreadsheet you sent get changed?
 
Upvote 0
That's strange. Personal.xlsb doesn't attach itself to anything. My apologies for asking these basic questions, but are you sure that all of your macros from your personal.xlsb got attached to the spreadsheet you sent? Did your personal.xlsb, itself, get changed; or did the macros embedded in the spreadsheet you sent get changed?

Thanks for your reply Mr Kowz,

Yeak I think you are right ... one of the macro's embedded in the spreadhseet was changed and it was not associated with the work I sent back to this fella ... the macro was for another project altogether.
Or maybe it was just a glitch that changed that parameter and since I do not know enough about these matters I just associated the two events.
That is not good ... I feel bad now ... lol ... for all these months, here I am thinking that it was this fella who changed something and all along it could just have been a glitch of some sorts?

Well ... is still a good idea to protect these macros don't you think?

Thanks
 
Upvote 0
The personal.xlsb I normally don't have protected, since that is stored locally on my computer.

However, files that contain macros that are sent out, I would recommend protecting those from view, as you don't want them to inadvertently get edited (unless the end user is a power user that you want to have the freedom to edit as needed).
 
Upvote 0
Thanks MrKowz,

Great ... So I will save my next macro in a new VBAProject and then follow the directions you gave earlier to ensure that it is protected from view.
It is good to know that the personal.xlsb does not travel with ones workbook.

Thanks again.
 
Upvote 0
Thanks MrKowz,

Great ... So I will save my next macro in a new VBAProject and then follow the directions you gave earlier to ensure that it is protected from view.
It is good to know that the personal.xlsb does not travel with ones workbook.

Thanks again.

Not a problem, thanks for the feedback! ;)
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top