Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Restricting rights to save a spreadsheet

I tried to save this once and received an error. I hope I didn't duplicate
my question.

I have a worksheet I created that imports data from one spreadsheet to
another, then runs several formula calculations on the retrieved data. I
want to be able to place in on our intranet and allow users to access it, but
not to be able to save any changes. I have restriced the cells, but also
want to restrict the worksheet so it cannot be saved to a hard drive or
anywhere else.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Restricting rights to save a spreadsheet

Unfortunately, I don't believe that you can prevent the workbook from
being copied off your network. You can make it more difficult, by using
some VBA to prevent saving from within Excel, but this will have no
effect if someone wants to just copy the file when the workbook is
closed. (Baring, of course, and security that your network admins may
be able to set up.)

If you want to disable saving from within Excel, you could use the
following code to do so:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not Application.UserName = "Ken Puls" Then Cancel = True
End Sub

Update my name to your username as defined in Tools|Options|General -
Usename. The code would go in the ThisWorkbook module of your VB
Project. To get it the

-Press Alt+F11 to enter the Visual Basic Editor
-Press Ctrl+R to display the explorer if it is not showing
-Find your project and drill into the ThisWorkbook module
-Paste the code there. Dont' forget to modify your username

This code means that only you will be able to save the workbook, and
then only if you are at a PC which uses the MS Office username I pointed
you to above. It will discard changes silently. You will also get
macro warnings from this point forward.

HTH,

Ken Puls, CMA - Microsoft MVP (Excel)
www.excelguru.ca

GeneR wrote:
I tried to save this once and received an error. I hope I didn't duplicate
my question.

I have a worksheet I created that imports data from one spreadsheet to
another, then runs several formula calculations on the retrieved data. I
want to be able to place in on our intranet and allow users to access it, but
not to be able to save any changes. I have restriced the cells, but also
want to restrict the worksheet so it cannot be saved to a hard drive or
anywhere else.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Restricting rights to save a spreadsheet

Hummmm. This macro did not work for me. All Save buttons are still activated.
Should not there be a "End If" in the code?
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Restricting rights to save a spreadsheet

Leandro

Ken's code does not hide or make unavailable the Save buttons.

It just cancels any Save if user name is not correct.

Doesn't need an "End If"

Stick one in and see what happens just for your own edification.


Gord Dibben MS Excel MVP

On Sat, 18 Nov 2006 14:58:01 -0800, Leandro
wrote:

Hummmm. This macro did not work for me. All Save buttons are still activated.
Should not there be a "End If" in the code?


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
Restricting a Spreadsheet so users cannot save changes GeneR Excel Worksheet Functions 1 October 31st 06 09:16 PM
trying to save someone else's updated spreadsheet Ninip Excel Discussion (Misc queries) 4 May 16th 06 05:56 PM
how to save spreadsheet at a specific time Sean Excel Discussion (Misc queries) 0 January 30th 06 10:13 PM
Save data retreived from query without saving query Anthony Excel Discussion (Misc queries) 0 January 25th 06 07:17 PM
save spreadsheet as web page bobmarshall043 Excel Discussion (Misc queries) 0 October 6th 05 08:35 PM


All times are GMT +1. The time now is 04:07 PM.

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"