ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hiding VB Code (https://www.excelbanter.com/excel-discussion-misc-queries/223570-hiding-vbulletin-code.html)

johnsail

Hiding VB Code
 
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and select
View, you can see all the code - including the password that is "protecting"
the sheet.

John

Bob Phillips

Hiding VB Code
 
Password protect the VBA project, ToolsProject PropertiesProtection

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"johnsail" wrote in message
...
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and
select
View, you can see all the code - including the password that is
"protecting"
the sheet.

John




Don Guillett

Hiding VB Code
 
At the top of the module put
Option private module
and they can't see it from toolsmacros
Also, protect the macro project to deny access to most people.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"johnsail" wrote in message
...
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and
select
View, you can see all the code - including the password that is
"protecting"
the sheet.

John



johnsail

Hiding VB Code
 
Hi Bob
Not sure what you mean here.
When I go into VBA project, ToolsProject Properties the project name
"VBAProject" is highlighted.
If i tyen go to protection and tick the box and enter a password it seems to
make no difference.

If I try to give the project a name it tells me that the name I have chosen
is not valid.
What am I missing?
Do I have to save the code in some special way?

John

"Bob Phillips" wrote:

Password protect the VBA project, ToolsProject PropertiesProtection

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"johnsail" wrote in message
...
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and
select
View, you can see all the code - including the password that is
"protecting"
the sheet.

John





johnsail

Hiding VB Code
 
Hi Don

Don't understand what you mean here. Can you explain a bit further please.

John

"Don Guillett" wrote:

At the top of the module put
Option private module
and they can't see it from toolsmacros
Also, protect the macro project to deny access to most people.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"johnsail" wrote in message
...
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and
select
View, you can see all the code - including the password that is
"protecting"
the sheet.

John




Gord Dibben

Hiding VB Code
 
When you set a password on VBAProjectProtection "lock for viewing" you
must save and close the workbook.

When you re-open, the protection is functional.


Gord Dibben MS Excel MVP

On Mon, 9 Mar 2009 08:15:01 -0700, johnsail
wrote:

Hi Bob
Not sure what you mean here.
When I go into VBA project, ToolsProject Properties the project name
"VBAProject" is highlighted.
If i tyen go to protection and tick the box and enter a password it seems to
make no difference.

If I try to give the project a name it tells me that the name I have chosen
is not valid.
What am I missing?
Do I have to save the code in some special way?

John

"Bob Phillips" wrote:

Password protect the VBA project, ToolsProject PropertiesProtection

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"johnsail" wrote in message
...
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and
select
View, you can see all the code - including the password that is
"protecting"
the sheet.

John






Don Guillett

Hiding VB Code
 

Pretty simple..
At the top of the module put
Option private module
and they can't see it from toolsmacros

type option private module as the top line in the module. Same as typing
private sub thissub() for each

Now goto toolsmacrosmacros and you will not see your macros anymore.
To work in the module comment out the line and then uncomment when through

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"johnsail" wrote in message
...
Hi Don

Don't understand what you mean here. Can you explain a bit further please.

John

"Don Guillett" wrote:

At the top of the module put
Option private module
and they can't see it from toolsmacros
Also, protect the macro project to deny access to most people.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"johnsail" wrote in message
...
How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and
select
View, you can see all the code - including the password that is
"protecting"
the sheet.

John






All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com