Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Queries once the Worksheet has been Protected

Status
Not open for further replies.

nzscout

Technical User
Jun 15, 2004
14
US
I have created a pricing grid, and are using a database query to populate the grid. I want users to not be able to touch this query. But everytime I protect the worksheet the query will not run.. Is there anything I can do. I have tried everything
 
Hi,

Unprotect in your code before any change method is executed. Then Protect after all change methods are executed.

Skip,
[sub]
[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue][/sub]

 
The problem I have with that is, that the Database query will be run many times during a day, with different parameters being entered by the users. I need to protect the worksheet once and not have to worry about it again.
 

Is the query executed within a macro or from a change event?

Skip,
[sub]
[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue][/sub]

 
well stick the protect / unprotect in the change event then !!

Other than that, have a look at the userinterfaceonly argument of the protection method - this will allow code to run whilst at the tsame time making the sheet protected from user interference.

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top