Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving it as read only?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving it as read only?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving it as read only?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving it as read only?

Kill "Filename.xls"



--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Saving it as read only?

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
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
Read only vs file saving Rich D Excel Discussion (Misc queries) 1 October 23rd 07 03:50 PM
Read-only error saving to network Will B Excel Discussion (Misc queries) 0 May 2nd 05 05:59 PM
How do I keep other users from saving my read-only document? bumblebug Excel Discussion (Misc queries) 2 March 4th 05 06:35 PM
after saving to cd many times. now says read only? nsturre Excel Discussion (Misc queries) 2 February 17th 05 09:16 PM
Saving a file within a macro but only when it does not have a read only attribute Alex Excel Programming 2 September 16th 03 04:19 PM


All times are GMT +1. The time now is 02:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"