Restricting save ability of an excel file

Y

YB

Hi there,
I'd like to give access to a wide range of users to an excel file.
They should have all the usual rights to use the excel file except that they
should not be able to save the file on their computer or elsewhere. This
file would and should only remain on a server and never save else where by
common users.
Is there a simple method to unable the save or save as ability of an excel
file ?
Thanks,
YB
 
S

Stewart

I'm not 100% sure but try this go to the workbook module
on visual basic editor and put in this code:-

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,
Cancel As Boolean)
Cancel = True
End Sub

please note that the cancel... line should be included in
the top line of code

I hope that works

Stewart Walker
 
K

keepitcool

Add following in the code module for thisworkbook...


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
End Sub

user's can of course circumvent this by disabling events or macro's
but in most cases it will do nicely.


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Y

YB

Hi,
Does anybody know how to unable automatically the macro at the opening of an
excel file? The macro would be unabled without prompting the user. But also
wihout changing the security level of the macro menu.

Or alternatively, automatically cancel the opening of file if the user
choose to disable the macro?

Thanks
YB
 
D

DNF Karran

The user gets control over turning on macros and the code canno
directly change this- it is a security measure to stop viruses.

All you can do is hide all sheets except for a front sheet which say
"You must enable macros to use this workbook". The structure of th
workbook is then protected so users cannot get at the data.

You then have macros triggered by the workbook open event that unhid
the hidden sheets so the spreadsheet can only be used with macro
enabled.

Dunca
 
Top