#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Private Sub

How do I stop "Private Subs" in "ThisWorkbook" on opening from executing.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Private Sub

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are there any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from executing.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Private Sub



"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are there any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from executing.

Thanks


Norman


1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by adding that if you do not
enable macros, you are done.

Where do we go from here?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Private Sub

What exactly is the question? Your addition doesn't answer Norman's
questions IMO.

The only event that fires on opening is workbook open. You cannot stop that
except by disabling macros, with the effect that no macros run. If you want
to stop a user from having access to your workbook if they disable macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are there

any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from

executing.

Thanks


Norman


1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by adding that if you do not
enable macros, you are done.

Where do we go from here?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Private Sub

Bob,
That's what he said. If he disables macros it stops the code from
executing. So he was saying he found the answer himself.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
What exactly is the question? Your addition doesn't answer Norman's
questions IMO.

The only event that fires on opening is workbook open. You cannot stop

that
except by disabling macros, with the effect that no macros run. If you

want
to stop a user from having access to your workbook if they disable macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are there

any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from

executing.

Thanks

Norman


1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by adding that if you do

not
enable macros, you are done.

Where do we go from here?







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Private Sub

Hi Tom,

I read it that way too, but he ended with

.... Where do we go from here?

That is where I got confused.

Bob


"Tom Ogilvy" wrote in message
.. .
Bob,
That's what he said. If he disables macros it stops the code from
executing. So he was saying he found the answer himself.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
What exactly is the question? Your addition doesn't answer Norman's
questions IMO.

The only event that fires on opening is workbook open. You cannot stop

that
except by disabling macros, with the effect that no macros run. If you

want
to stop a user from having access to your workbook if they disable

macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are

there
any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from

executing.

Thanks

Norman

1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by adding that if you do

not
enable macros, you are done.

Where do we go from here?







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Private Sub

Based on the whole thread, I would say he was just being cute. Of course,
that is just my opinion.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
Hi Tom,

I read it that way too, but he ended with

... Where do we go from here?

That is where I got confused.

Bob


"Tom Ogilvy" wrote in message
.. .
Bob,
That's what he said. If he disables macros it stops the code from
executing. So he was saying he found the answer himself.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
What exactly is the question? Your addition doesn't answer Norman's
questions IMO.

The only event that fires on opening is workbook open. You cannot stop

that
except by disabling macros, with the effect that no macros run. If you

want
to stop a user from having access to your workbook if they disable

macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are

there
any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from
executing.

Thanks

Norman

1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by adding that if you

do
not
enable macros, you are done.

Where do we go from here?









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Private Sub



"Tom Ogilvy" wrote:

Based on the whole thread, I would say he was just being cute. Of course,
that is just my opinion.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
Hi Tom,

I read it that way too, but he ended with

... Where do we go from here?

That is where I got confused.

Bob


"Tom Ogilvy" wrote in message
.. .
Bob,
That's what he said. If he disables macros it stops the code from
executing. So he was saying he found the answer himself.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
What exactly is the question? Your addition doesn't answer Norman's
questions IMO.

The only event that fires on opening is workbook open. You cannot stop
that
except by disabling macros, with the effect that no macros run. If you
want
to stop a user from having access to your workbook if they disable

macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution and why? Are

there
any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in message
...
How do I stop "Private Subs" in "ThisWorkbook" on opening from
executing.

Thanks

Norman

1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by adding that if you

do
not
enable macros, you are done.

Where do we go from here?







First of all, let me state that what I am trying to do is protect my work. I know that this is not possible, but I am trying to make it as difficult as possible.


Through the help of this discussion group and individuals such as Tom and
Bob, I believe that I have created a workbook that would be very difficult to
obtain the formulas or code from (hopefully impossible, as a newbie I think
it is).

Since the worksheet is run/protected by routines I do not want to let
someone open it without macros running - by "Disable Macros" upon opening.

Thomas Ramel provided me a round about way to prevent one from opening w/o
macros with an addin procedure in Private Sub Workbook_Open. It works great.
If one clicks "Disable Macros" it stops. They are done.

However last night when trying to break into it (and I have no idea how to
do it) I did something that let me get into the workbook without enabling
macros. I do not know what I did but it seems to me that the workbook opened
without executing the code in "Private Sub Workbook_Open". Thus my question;

How do I stop "Private Subs" in "ThisWorkbook" on opening from executing.

I liked Norms response because I read it to question my intent with, "why
and are there any other salient (silent) factors". To many times I see
someone asking how to break into or bypass protection and someone here
provides answers. I believe that If someone wants to bypass protection, let
them figure it out on their own or better yet take it to their programming
professionals who can verify ownership and use their skills to open the
workbook.

As alway, thanks for your help and help in the past.






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Private Sub

You can prevents events from occurring at startup by holding down
the SHIFT key when you open the workbook. Another way is to set
Application.EnableEvents = False before opening the workbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ronbo" wrote in message
...


"Tom Ogilvy" wrote:

Based on the whole thread, I would say he was just being cute.
Of course,
that is just my opinion.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in
message
...
Hi Tom,

I read it that way too, but he ended with

... Where do we go from here?

That is where I got confused.

Bob


"Tom Ogilvy" wrote in message
.. .
Bob,
That's what he said. If he disables macros it stops the
code from
executing. So he was saying he found the answer himself.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
What exactly is the question? Your addition doesn't
answer Norman's
questions IMO.

The only event that fires on opening is workbook open.
You cannot stop
that
except by disabling macros, with the effect that no
macros run. If you
want
to stop a user from having access to your workbook if
they disable
macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in
message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution
and why? Are
there
any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in
message
...
How do I stop "Private Subs" in "ThisWorkbook" on
opening from
executing.

Thanks

Norman

1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by
adding that if you

do
not
enable macros, you are done.

Where do we go from here?







First of all, let me state that what I am trying to do is
protect my work. I know that this is not possible, but I am
trying to make it as difficult as possible.


Through the help of this discussion group and individuals such
as Tom and
Bob, I believe that I have created a workbook that would be
very difficult to
obtain the formulas or code from (hopefully impossible, as a
newbie I think
it is).

Since the worksheet is run/protected by routines I do not want
to let
someone open it without macros running - by "Disable Macros"
upon opening.

Thomas Ramel provided me a round about way to prevent one from
opening w/o
macros with an addin procedure in Private Sub Workbook_Open.
It works great.
If one clicks "Disable Macros" it stops. They are done.

However last night when trying to break into it (and I have no
idea how to
do it) I did something that let me get into the workbook
without enabling
macros. I do not know what I did but it seems to me that the
workbook opened
without executing the code in "Private Sub Workbook_Open".
Thus my question;

How do I stop "Private Subs" in "ThisWorkbook" on opening from
executing.

I liked Norms response because I read it to question my intent
with, "why
and are there any other salient (silent) factors". To many
times I see
someone asking how to break into or bypass protection and
someone here
provides answers. I believe that If someone wants to bypass
protection, let
them figure it out on their own or better yet take it to their
programming
professionals who can verify ownership and use their skills to
open the
workbook.

As alway, thanks for your help and help in the past.








  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Private Sub


I believe that If someone wants to bypass protection, let
them figure it out on their own or better yet take it to their programming
professionals who can verify ownership and use their skills to open the
workbook.


The problem is that the cat is already out of the bag. Excel's security is
weak, and there is enough information out in the public domain such that it
doesn't take much research to find out how to crack it.




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Private Sub



"Chip Pearson" wrote:

You can prevents events from occurring at startup by holding down
the SHIFT key when you open the workbook. Another way is to set
Application.EnableEvents = False before opening the workbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Ronbo" wrote in message
...


"Tom Ogilvy" wrote:

Based on the whole thread, I would say he was just being cute.
Of course,
that is just my opinion.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in
message
...
Hi Tom,

I read it that way too, but he ended with

... Where do we go from here?

That is where I got confused.

Bob


"Tom Ogilvy" wrote in message
.. .
Bob,
That's what he said. If he disables macros it stops the
code from
executing. So he was saying he found the answer himself.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
What exactly is the question? Your addition doesn't
answer Norman's
questions IMO.

The only event that fires on opening is workbook open.
You cannot stop
that
except by disabling macros, with the effect that no
macros run. If you
want
to stop a user from having access to your workbook if
they disable
macros,
you cannot, but you can take some mitigating action.

--
HTH

-------

Bob Phillips
"Ronbo" wrote in
message
...


"Norman Jones" wrote:

Hi Ronbo,

I think you ned to give a little more detail.

For example, when do you want to prevent execution
and why? Are
there
any
other salient factors?


---
Regards,
Norman



"Ronbo" wrote in
message
...
How do I stop "Private Subs" in "ThisWorkbook" on
opening from
executing.

Thanks

Norman

1) I loved your response.

2) I appreciated your questions.

3) I was just getting ready to update my post by
adding that if you
do
not
enable macros, you are done.

Where do we go from here?







First of all, let me state that what I am trying to do is
protect my work. I know that this is not possible, but I am
trying to make it as difficult as possible.


Through the help of this discussion group and individuals such
as Tom and
Bob, I believe that I have created a workbook that would be
very difficult to
obtain the formulas or code from (hopefully impossible, as a
newbie I think
it is).

Since the worksheet is run/protected by routines I do not want
to let
someone open it without macros running - by "Disable Macros"
upon opening.

Thomas Ramel provided me a round about way to prevent one from
opening w/o
macros with an addin procedure in Private Sub Workbook_Open.
It works great.
If one clicks "Disable Macros" it stops. They are done.

However last night when trying to break into it (and I have no
idea how to
do it) I did something that let me get into the workbook
without enabling
macros. I do not know what I did but it seems to me that the
workbook opened
without executing the code in "Private Sub Workbook_Open".
Thus my question;

How do I stop "Private Subs" in "ThisWorkbook" on opening from
executing.

I liked Norms response because I read it to question my intent
with, "why
and are there any other salient (silent) factors". To many
times I see
someone asking how to break into or bypass protection and
someone here
provides answers. I believe that If someone wants to bypass
protection, let
them figure it out on their own or better yet take it to their
programming
professionals who can verify ownership and use their skills to
open the
workbook.

As alway, thanks for your help and help in the past.







Chip:


Thanks for the suggestions. I maybe doing something wrong but I could not
get either to work. Which is of course what I want.

When holding down the SHIFT key when opening the workbook I get the error
message "Can not open Excel Add-in for Editing. Please Edit the Source Doc
Instead." Holding down the SHIFT key and clicking OK returns the error
message 4 times. Then the "Enable/Disable Macro" dialog box appears.
Holding down the SHIFT key and clicking "Disable" returns the error message
for 2 times and then stops trying to open the workbook. This is what I want
to happen(not opening) from the code in "Private Sub Workbook_Open"

I then opened a workbook and invoked "Application.EnableEvents = False.
Then I tried to open my protected workbook without macros and it did what I
want it to do, it stopped.

If you/anyone has any idea what I am doing wrong (hopefully nothing) I would
be interested. Otherwise I think I have wasted enough time on what must of
been a fluk last night.

Bob:

I know its out there and easy to find. Its just my opinion that it should
not be made easier.

Thanks to all.
Ronbo

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Private Sub

Hi Ronbo,

I liked Norms response because I read it to question my intent with, "why
and are there any other salient (silent) factors".


Just for the record, I intentionally used "Salient" rather than your
interpreted silent.

I used salient in its dictionary defined sense:

standing out conspicuously, noticeable or striking: particularly noticeable
or important, striking, or relevant


---
Regards,
Norman


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Private Sub() - Sub() CousinExcel Excel Discussion (Misc queries) 2 January 18th 10 01:39 PM
Private sub problem sby Excel Worksheet Functions 1 November 28th 07 04:50 PM
Private sub Mark New Users to Excel 3 April 6th 05 03:36 PM
Private subs Flima Excel Programming 1 January 7th 05 10:05 PM
Problem with private sub Conrado Capistrano Excel Programming 2 October 4th 03 08:35 AM


All times are GMT +1. The time now is 01:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"