Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone help me?
Im trying to save a spreadsheet as read only. However, When I look through the options on the code in VBA, I canno see an option for read only? Only Read Only Recommended. I tried setting the Activeworkbook.Writepassword = "password" but this just prevents me saving the spreadsheet altogether as it say it cannot access read only document "Quotes 2004" Here is my code Activeworkbook.Writepassword = "password" chdir "C:\" ActiveWorkBook.Saveas Filename :="Y:\working files\quotes2004.xls" FileFormat:=xlNormal, Password:="", readonlyrecommended="false" Any ideas -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure the exact reason for wanting it to be read only, but here'
some suggestions. - Protect the workbook with a password. Then the user will not be abl to make any changes (so saving it would not matter). - Save the workbook to a directory that the users only hav Read/Execute privelage. (my preference) -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my example, it is setting the file to have a password if you look a
the VBA but that is not sufficient. I have found out that I need to do the following: SetAttr filename, vbReadOnly but i need to delete the original file first as it wont let m overwite Anyone know how I delete the original file without opening it? Any hlep would be appreciated -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't know if you want a password or not, but having a password doesn't
have much to do with readonly. for readonly , save the workbook as normal, close it, then use the setattr to mark it as read only. See VBA help for arguments to setattr. -- Regards, Tom Ogilvy "andycharger " wrote in message ... Can someone help me? Im trying to save a spreadsheet as read only. However, When I look through the options on the code in VBA, I cannot see an option for read only? Only Read Only Recommended. I tried setting the Activeworkbook.Writepassword = "password" but this just prevents me saving the spreadsheet altogether as it says it cannot access read only document "Quotes 2004" Here is my code Activeworkbook.Writepassword = "password" chdir "C:\" ActiveWorkBook.Saveas Filename :="Y:\working files\quotes2004.xls", FileFormat:=xlNormal, Password:="", readonlyrecommended="false" Any ideas? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Read only vs file saving | Excel Discussion (Misc queries) | |||
Read-only error saving to network | Excel Discussion (Misc queries) | |||
How do I keep other users from saving my read-only document? | Excel Discussion (Misc queries) | |||
after saving to cd many times. now says read only? | Excel Discussion (Misc queries) | |||
Saving a file within a macro but only when it does not have a read only attribute | Excel Programming |