VBAProject Properties - Protection.

T

tal

Hello Everyone.

Is it possible to control VBAProject protection by code?
I don't mean excel's sheet protection, but the code
segment.

Thanks a lot, Tal.
 
L

Leo Heuser

Hello Tal

No, it's not possible, at least from
Excel 2000 and backward. I can't
check Excel 2002/2003 right now.
 
A

A.W.J. Ales

Hi Tal,

In XP and in the VB editor :
TOOLS / VBAProject properties.../ tab Protection

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
V

Vasant Nanavati

I think he meant by code <g>.

--

Vasant

A.W.J. Ales said:
Hi Tal,

In XP and in the VB editor :
TOOLS / VBAProject properties.../ tab Protection

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
H

Harlan Grove

Leo Heuser said:
No, it's not possible, at least from
Excel 2000 and backward. I can't
check Excel 2002/2003 right now.
....

Not even with a lot of SendKey statements?
 
A

A.W.J. Ales

Hi Leo, Vasant,

You two are right. I completely overlooked that. :(


--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

Leo Heuser said:
Hi Auk

But Tal asked, if it was possible to protect
a project with *code*
 
D

Dave Peterson

The first post I saw that used Sendkeys with protecting the project was by Bill
Manville.
http://groups.google.com/[email protected]

And if you stay away from the keyboard/mouse and let the macro run without
disturbance, it works ok for me.

To the OP: Sendkeys will send stuff to whatever application has focus--so if
you're in the middle of another application, your project may not be protected
and you may have some unintentional changes to the current application.
 
D

Dave Peterson

Another option that may work (depending on lots of things!):

If you're creating a new workbook and importing code, it might be better to
create a template workbook that already includes the code. Lock the project
beforehand and don't import the code (it's already there) and don't worry about
locking the project.
 
L

Leo Heuser

Harlan Grove said:
...

Not even with a lot of SendKey statements?
What I meant was, that protecting/unprotecting a project,
isn't a method/property of the VBE object, but Bill Manville's
solution shows, that it can indeed be accomplished with SendKey,
so I stand corrected.

LeoH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top