Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

How to protect excel workbook from macro starting from Developer - Code ribbon?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ivan - 26 Nov 2007 09:25 GMT
Hello,

in my excel workbook project I use a lot of VBA code where I open different
external data sources, hide and unhide some worksheets and do things that
shoul not be explicitly viewed by normal users. So I protected Visual Basic
code with a password what is probably not the best security (?) but it is
probably enough for our not so experienced internal users.

What disturbs me is but that the user can clicks on Macros icon from the
Developer - Code ribbon and then he can see the list of all my programs
defined in my Visual basics Modules. And not only see - the user can even
run any od these programs alone and on such way ,because of uncontrolled
treatment, he can cause unexpected consequences.

Is there any way how to disable user from such uncontrolled actions?

Ivan
The Dude - 26 Nov 2007 11:51 GMT
Hello Ivan,

You can start by putting "private" in front of your subs. It hides them from
the list of macros (you can still launch them if you type the name), but can
be problematic if you try to call a procedure from another module.

> Hello,
>
[quoted text clipped - 13 lines]
>
> Ivan
Ivan - 26 Nov 2007 12:32 GMT
I have suspected the solution of "private" functions and subs but the
problem is exactly in the (un)attainability of such code from the code of
worksheets, forms and other modules. As I understand the only way to reach
my goal now is to displace all code from modules to worksheets and forms. In
this way I lose by all means the universality od modul code!?

Ivan

> Hello Ivan,
>
[quoted text clipped - 23 lines]
>>
>> Ivan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.