Hi,
I have wriyyen a VBAcode in Excel Now i want the the code to be
protected nor to be seen by others to avoid mishandling, as my
worksheet is a shred one. help me how to protect the code.
Regards
Bobby.
Hi,
I have wriyyen a VBAcode in Excel Now i want the the code to be
protected nor to be seen by others to avoid mishandling, as my
worksheet is a shred one. help me how to protect the code.
Regards
Bobby.
Goto to the VB editor (Alt-F11), then in the "Project Explorer" Window (if
it is not visible then choose View->Project Explorer from the main menu)
click on the VBA Project heading for the workbook code you wish to protect
and right click, choose VBA Project Properties. In the project properties
dialog choose protection and set the password etc.
Next time you open the workbook you cannot view the code without the
password.
NOTE: This is not a totally secure method but will stop most tampering.
--
Cheers
Nigel
"bobby" <[email protected]> wrote in message
news:[email protected]...
> Hi,
>
> I have wriyyen a VBAcode in Excel Now i want the the code to be
> protected nor to be seen by others to avoid mishandling, as my
> worksheet is a shred one. help me how to protect the code.
>
> Regards
>
> Bobby.
>
Hi Nigel,
Thankyou for the answer.
Thanks and Regards
Bobby
Nigel, is there any way to prevent the name of the macros from showing
up in Tools, Macros, Macros...? Or can you at least prevent a user
from running the macro?
I posted this question yesterday, but got no responses:
*****************************************************
I've written an application and I've protected both the worksheets and
the VBA code. But the macros still show in Tools, Macros, Macros...
A user can still select and run a macro from the Tools menu. I want to
control all macros from the buttons I have on the various sheets of the
workbook. Can I hide the macro names and/or prevent "Run" from being
chosen?
*****************************************************
Thanks, Nashua
--
Nashua
------------------------------------------------------------------------
Nashua's Profile: http://www.highdots.com/forums/m1420
View this thread: http://www.highdots.com/forums/t3081206
If you declare your sub as Private then they will not be visible in the
Run-Macro menu e.g.
Private Sub Macro1()
Also if you pass parameters then they will not be visible e.g.
Sub Macro2(par1)
This is also true for public subs e.g.
Public Sub Macro3(par1)
Take a look at the VB help for the Sub Statement for limitations of the
scope of these different types of Subs.
If also worth noting that Functions are also not visible in the Run-Macro
menu.
--
Cheers
Nigel
"Nashua" <[email protected]> wrote in message
news:[email protected]...
>
> Nigel, is there any way to prevent the name of the macros from showing
> up in Tools, Macros, Macros...? Or can you at least prevent a user
> from running the macro?
>
> I posted this question yesterday, but got no responses:
>
> *****************************************************
> I've written an application and I've protected both the worksheets and
> the VBA code. But the macros still show in Tools, Macros, Macros...
>
> A user can still select and run a macro from the Tools menu. I want to
> control all macros from the buttons I have on the various sheets of the
> workbook. Can I hide the macro names and/or prevent "Run" from being
> chosen?
> *****************************************************
>
> Thanks, Nashua
>
>
> --
> Nashua
> ------------------------------------------------------------------------
> Nashua's Profile: http://www.highdots.com/forums/m1420
> View this thread: http://www.highdots.com/forums/t3081206
>
You can also add
Option Private Module
at the start of a module, to prevent the macros contained within it being
displayed in the "Run" list.
regards
Pete
"Nigel" wrote:
> If you declare your sub as Private then they will not be visible in the
> Run-Macro menu e.g.
>
> Private Sub Macro1()
>
> Also if you pass parameters then they will not be visible e.g.
>
> Sub Macro2(par1)
>
> This is also true for public subs e.g.
>
> Public Sub Macro3(par1)
>
> Take a look at the VB help for the Sub Statement for limitations of the
> scope of these different types of Subs.
>
> If also worth noting that Functions are also not visible in the Run-Macro
> menu.
>
>
> --
> Cheers
> Nigel
>
>
>
> "Nashua" <[email protected]> wrote in message
> news:[email protected]...
> >
> > Nigel, is there any way to prevent the name of the macros from showing
> > up in Tools, Macros, Macros...? Or can you at least prevent a user
> > from running the macro?
> >
> > I posted this question yesterday, but got no responses:
> >
> > *****************************************************
> > I've written an application and I've protected both the worksheets and
> > the VBA code. But the macros still show in Tools, Macros, Macros...
> >
> > A user can still select and run a macro from the Tools menu. I want to
> > control all macros from the buttons I have on the various sheets of the
> > workbook. Can I hide the macro names and/or prevent "Run" from being
> > chosen?
> > *****************************************************
> >
> > Thanks, Nashua
> >
> >
> > --
> > Nashua
> > ------------------------------------------------------------------------
> > Nashua's Profile: http://www.highdots.com/forums/m1420
> > View this thread: http://www.highdots.com/forums/t3081206
> >
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks