PDA

View Full Version : VBAProject



Rema
10-17-2008, 11:48 PM
Hi all,

I have protected macros with password.

If the user click on vbaproject, is it possible to give alert message, 'macros cannot be viewed?' or any options to 'disable the VBAProject password prompt dialog?'

Thank you in advance

Regards
Rema

GTO
10-17-2008, 11:56 PM
Greetings Rema,

I don't believe there's any way around the password alert coming up.

Though thinking about it, if there was, you'd never be able to get back into the project:mkay ...

Regards and have a good weekend,

Mark

Demosthine
10-18-2008, 02:01 PM
Good Afternoon.

There are two "sort-of" solutions for your problem.

The first involves setting your workbook to Shared. Depending on the size and amount of updating, this may be a very bad idea. When you set a workbook to shared, it starts tracking all changes to every sheet in the workbook. This data is stored and a hidden worksheet. Obviously, that can get to be a very large worksheet if you do a lot of updating.

The upside to this method is that Macros can not be viewed while the workbook is in Shared Mode. Period. The user has to have the password to Unshare the Workbook in order to even get to the dialog for the VBAProject Password.


The other is a much more involved workaround. There are several different ways to access the VBE, but they can all be disabled. Just remember, like GTO said, that if you do this, you have to have a backdoor for yourself to access it later.

Basically, this method will need to disable the ShortcutKey Alt+F11 as well as the CommandButton on the Visual Basic Toolbar (or the Toolbar itself). this can be quite a bit of work, though.


I do not recommend pursueing this as it's more hassle than it's worth and if you don't re-enable the commands before closing the workbook, you may not be able to access them from other workbooks at later times.

Scott

Rema
10-18-2008, 11:07 PM
Thank you very much for your reply.

Actually, we are creating a template, where only the instance of the template is given to the user. So we want to restrict the users, viewing or editing the macros. Any changes to be made in macros, it can be done in master template, so we can avoid, user editing macros.

Working on VBE properties.

If we disable the Alt+F11, there is a problem, only for this particular workbook instance we cant do it. If user writes macros, or if he has any shortcut Alt+F11, we cant disable it.

Thank you verymuch for your reply.

Regards
Rema