Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way in a macro to force read only?
I see that you can set readonlyRecommended=True. However, when my users open up the file, they still have the ability t open it as normal if they select it with the warning. What I want to do if force my file to save in readonly and not let the open it any other way. Is there a way to do this when saving the file in the macro before give it to my staff -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try setting the file attribute to read-only, this way
Excel will open as read-only without asking. This is an operating system level attribute so potentially could be changed outside of Excel. In VBA use...... SetAttr "file", vbReadOnly Since you presumably do not want your staff to change the contents you might want to prevent "saving" this file as well by disabling the save menu options. -----Original Message----- Is there a way in a macro to force read only? I see that you can set readonlyRecommended=True. However, when my users open up the file, they still have the ability to open it as normal if they select it with the warning. What I want to do if force my file to save in readonly and not let them open it any other way. Is there a way to do this when saving the file in the macro before I give it to my staff? --- Message posted from http://www.ExcelForum.com/ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you have to set the password on the options when
you first save the file (keep the password simple, and keep a record somewhere) -----Original Message----- Is there a way in a macro to force read only? I see that you can set readonlyRecommended=True. However, when my users open up the file, they still have the ability to open it as normal if they select it with the warning. What I want to do if force my file to save in readonly and not let them open it any other way. Is there a way to do this when saving the file in the macro before I give it to my staff? --- Message posted from http://www.ExcelForum.com/ . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Application.DisplayAlerts = False
ThisWorkbook.SaveAs ThisWorkbook.FullName, , , "sesame" Application.DisplayAlerts = True should do it. The user would need the password ("sesame") to override the read-only requirement. -- Vasant "andycharger " wrote in message ... Is there a way in a macro to force read only? I see that you can set readonlyRecommended=True. However, when my users open up the file, they still have the ability to open it as normal if they select it with the warning. What I want to do if force my file to save in readonly and not let them open it any other way. Is there a way to do this when saving the file in the macro before I give it to my staff? --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you tell me how I disable the Save option in the menu then?
I need to do this either before or during the save of the document Obviously I dont want to make it part of a macro that runs when a use opens the file as they can choose to disable macros! Also you mention the set attr function. Where do I set it and what do type? Any ideas -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy,
The workbook has a _BeforeSave event, with a Cancel parameter. That might do the trick. Password protect the VBA code also, so it cannot be bypassed. Anyone can still Copy the sheet to a new workbook though, by right clicking on the sheet tab, so you would need to Hide sheet tabs form the Options and protect the worksheet also. NickHK "andycharger " wrote in message ... Can you tell me how I disable the Save option in the menu then? I need to do this either before or during the save of the document. Obviously I dont want to make it part of a macro that runs when a user opens the file as they can choose to disable macros! Also you mention the set attr function. Where do I set it and what do I type? Any ideas? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Read only file is NOT Read only | Excel Discussion (Misc queries) | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
Read-write/Read-only | Excel Discussion (Misc queries) | |||
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) |