VBAProject Properties - Protection.

  • Thread starter Thread starter tal
  • Start date Start date
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.
 
Hello Tal

No, it's not possible, at least from
Excel 2000 and backward. I can't
check Excel 2002/2003 right now.
 
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 *
 
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 *
 
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?
 
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*
 
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.
 
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.
 
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
 
Back
Top