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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking down my spreadsheet 2

Status
Not open for further replies.

Malcav

Programmer
Oct 7, 2005
43
GB
Hi
I am working on a spread sheet the populates itself completly from sql. THe users have an area they can change and update but I want to stop them using anything else.
I have this chunk of code :
Code:
        With Application
           .DisplayFullScreen = True
           .CommandBars("Full Screen").Visible = False
           .CommandBars("MyToolbar").Enabled = True
           .CommandBars("MyToolbar").Visible = True
           .CommandBars("Worksheet Menu Bar").Enabled = False
        End With
but this gets ride of the sheet tabs which i need to see.
Also I have stopped all saving except when the press alt and f4. I have been looking on the web for about an hour and got nothing that work.
Can some one help please.
Ta
^I^
 
Have you tried setting the worksheet protections?

Unlock the cells you want them to use (format-cells-protection)and then (tools-protection-Protect Worksheet)



 
Hey CaptainD
Yeah they only have access to the ceels that they should however when it closes down (alt+f4) it allows them to 'save as' which we cant have there is some very vital business data stored in here.
 
hey yogia that worked perfectly solving my full screen problem now it is just the saving problem.
 
I understand that your workbook should NEVER be saved (by a user, anyway)?

If that is so, then simply putting
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
End Sub

in the ThisWorkbook object should stop it from being saved however they try to do it.

Cheers,

Roel
 
Still allows them to save if they do the alt+f4
 
THat did work however i cant now save it in place he he he.
 
Its cool I have done an if. THanks everyone thats great.
 
You should also prevents the shortcut keys for Copy/Paste, don't you ?
 
At the risk of blowing my own trumpet there may be some useful information for you in here faq707-4841

happy friday

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top