LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Read only without password

Private Sub CommandButton1_Click()
Dim sName as String
sName = "S:\Common\Gx\x.xls"
Application.DisplayAlerts = False
Kill sName
ActiveWorkbook.SaveAs ("s:\unit\q.xls"), FileFormat:=xlNormal, _
Password:="", WriteResPassword:=" ", ReadOnlyRecommended:=True _
, CreateBackup:=False
ActiveWorkbook.SaveCopyAs sName
setAttr sName, vbReadOnly
Application.DisplayAlerts = True
End Sub

--
Regards,
Tom Ogilvy



"Lawlera" wrote in message
...
Hi,

I am trying to create a read only open access copy of a file that is

password protected. Trouble is I can't remove the password from the copy
only and force read only onto the copy.

This is the code I tried:

Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Kill "S:\Common\Gx\x.XLS"
ActiveWorkbook.SaveAs ("s:\unit\q.xls"), FileFormat:=xlNormal,

Password:="", WriteResPassword:=" ", ReadOnlyRecommended:=True _
, CreateBackup:=False
ActiveWorkbook.SaveCopyAs ("S:\Common\Gx\x.XLS")
Application.DisplayAlerts = True
ActiveWorkbook.Close
End Sub

Appreciate any help.



 
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
Input password or open the sheet as "Read only Pietro Excel Discussion (Misc queries) 0 October 8th 07 09:40 PM
Password Prompt With Read Only Option Paperback Writer Excel Discussion (Misc queries) 2 August 14th 06 10:39 PM
Password opens as read only? jjacob Excel Discussion (Misc queries) 1 March 6th 06 11:36 PM
Read only password script box Joey041 Excel Discussion (Misc queries) 1 May 3rd 05 01:23 AM
How do I make a file read only unless a password is supplied? Tim Excel Discussion (Misc queries) 2 January 12th 05 10:48 PM


All times are GMT +1. The time now is 03:50 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"