![]() |
Saving or not a spreadsheet
I would like for users to be able to open my spreadsheets, use them but not
be able to save them, either using the "Save" or "Save as" commands. Is it possible and if so how? Thanks in advance..... Dean |
Saving or not a spreadsheet
in the object ThisWorkbook's BeforeSave event
add these two lines Cancel = True ActiveWorkbook.Saved = True if yuo want to be really mean, also add ActiveWorkbook.Close False "Dean" wrote: I would like for users to be able to open my spreadsheets, use them but not be able to save them, either using the "Save" or "Save as" commands. Is it possible and if so how? Thanks in advance..... Dean |
Saving or not a spreadsheet
Patrick,
Thanks for that however I now have another problem, how do I save it! With the code in I can't save the spreadsheet. Dean "Patrick Molloy" wrote: in the object ThisWorkbook's BeforeSave event add these two lines Cancel = True ActiveWorkbook.Saved = True if yuo want to be really mean, also add ActiveWorkbook.Close False "Dean" wrote: I would like for users to be able to open my spreadsheets, use them but not be able to save them, either using the "Save" or "Save as" commands. Is it possible and if so how? Thanks in advance..... Dean |
Saving or not a spreadsheet
its what you asked for. Anyway, select the event's first line of code and F9
to set a break point hit save, the when it breaks contimnue the code at the end sub line a better way would be to use a developer's flag... in a new module: Option Explicit Public DeveloperFlag As Boolean Private Sub set_DeveloperFlag() DeveloperFlag = True End Sub now wrap the event code like this... If DeveloperFlag = False Then Cancel = True 'etc End If "Dean" wrote: Patrick, Thanks for that however I now have another problem, how do I save it! With the code in I can't save the spreadsheet. Dean "Patrick Molloy" wrote: in the object ThisWorkbook's BeforeSave event add these two lines Cancel = True ActiveWorkbook.Saved = True if yuo want to be really mean, also add ActiveWorkbook.Close False "Dean" wrote: I would like for users to be able to open my spreadsheets, use them but not be able to save them, either using the "Save" or "Save as" commands. Is it possible and if so how? Thanks in advance..... Dean |
Saving or not a spreadsheet
Patrick,
Sorry If I didn't make myself 100% clear in the first place. I'll try better next time. Please let me say thank you for all you help. "Thank you for all your help" That is absolutly wonderful. Dean "Patrick Molloy" wrote: its what you asked for. Anyway, select the event's first line of code and F9 to set a break point hit save, the when it breaks contimnue the code at the end sub line a better way would be to use a developer's flag... in a new module: Option Explicit Public DeveloperFlag As Boolean Private Sub set_DeveloperFlag() DeveloperFlag = True End Sub now wrap the event code like this... If DeveloperFlag = False Then Cancel = True 'etc End If "Dean" wrote: Patrick, Thanks for that however I now have another problem, how do I save it! With the code in I can't save the spreadsheet. Dean "Patrick Molloy" wrote: in the object ThisWorkbook's BeforeSave event add these two lines Cancel = True ActiveWorkbook.Saved = True if yuo want to be really mean, also add ActiveWorkbook.Close False "Dean" wrote: I would like for users to be able to open my spreadsheets, use them but not be able to save them, either using the "Save" or "Save as" commands. Is it possible and if so how? Thanks in advance..... Dean |
All times are GMT +1. The time now is 08:56 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com