user2148238
user2148238

Reputation: 95

How to avoid the editing of a macro in Excel?

I have written a macro in Excel. When I send it to some user, he should not be able to see the macro.

Say I have a Excel workbook sample.xls, and it has a macro button to save the workbook to the server. When some other user opens the workbook, he should not be able to edit the macro behind that button.

How do I block other users from editing the code?

Upvotes: 1

Views: 805

Answers (2)

deostroll
deostroll

Reputation: 11975

You can password protect it. But I'd suggest you search how to do it for your specific version of MS Excel. There is a link which shows how to do it in MS Excel 2003, I think: http://www.ozgrid.com/VBA/protect-vba-code.htm

Upvotes: 0

Sudheej
Sudheej

Reputation: 2019

To lock a VBA project for viewing

Open the document, template, or database that contains the VBA project you want to protect. For Outlook or FrontPage, start Outlook or FrontPage on the computer that contains the VBA project you want to protect.

Open the Visual Basic Editor.

In the Project Explorer, right-click the project you want to protect, and then click ProjectName Properties on the shortcut menu.

On the Protection tab, select the Lock project for viewing check box, enter and confirm the password, and then click OK.

Upvotes: 1

Related Questions