Hiding/Protecting the code of macro

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

Is there a way to Hiding/Protecting the code of macro and
worksheet procedures from the users viewing it. Can it be
made pass-word accessible only.
 
Hi Mario

You can place Private before each sub you want to hide
Private Sub test()

Or add this at the top of the module for all the macro's
Option Private Module

This way you don't see it in the macro list (Alt-F8)


You can Protect your project in the VBA editor

Alt-F11
In the menubar Tools>VBA project properties
See the protection tab

This way they can't see or edit your code
 
When I protect the macro/vba code

tools -> VBAProject Properties -> select protection tab
select lock project.
enter password

I am not allow to save the spreadsheet
without unprotecting the macro.

any solutions ?
 
Then you do something wrong

Or do you mean that you can't use your own macro to save the workbook?
because you don't see it?
 
I protected the macro as stated earl
and saved the spreadsheet

I emailed the spreadsheet to a user
They entered some data into the spreadsheet and
then tried to save the spreadshee

here is the error message they received

You cannot save to this file format when the VBA projec
is protected

You may unprotect the VBA project by choosing in Projecties Comman
on the Visual basic editor's tools menu and entering the password for
the active project

I want to protect the macro, but allow users to change and save the data

George
 
Hi George

You save the file in two formats
Excel 97-2003 and 5.0/95

Save the file as Microsoft Excel workbook, This is the first option
in the SaveAs dialog
 
Back
Top