Thread: read only
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default read only

it is just a different way of skinng the same cat. I agree with you on the VB
function. Sometimes dos is kind of handy though (and I remember it better
than some of the functions in VB).
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

Why resort to shelling a "DOS" command if you can do it fine within VBA?

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote in message
...
Try to keep things in one thread. Makes it easier on all concerned... Give
this code a try...

Public Sub SetReadOnly()
Shell ("Command.com /c Attrib C:\Test.xls +r") 'Make Read Only
Shell ("Command.com /c Attrib C:\Test.xls -r") 'Undo Read Only
End Sub

This uses a file on the C Drive called Test.xls
--
HTH...

Jim Thomlinson


"lawson" wrote:

in addition to my previous question, when the file saves over the read

only
file, i would like it to make it a read only again.

thanks