Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Input password or open the sheet as "Read only | Excel Discussion (Misc queries) | |||
Password Prompt With Read Only Option | Excel Discussion (Misc queries) | |||
Password opens as read only? | Excel Discussion (Misc queries) | |||
Read only password script box | Excel Discussion (Misc queries) | |||
How do I make a file read only unless a password is supplied? | Excel Discussion (Misc queries) |