#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default read only

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default read only

that is why VBA provides the setattr command. Read about it in help.

--
Regards,
Tom Ogilvy


"lawson" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default read only

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default read only

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
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




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 file is NOT Read only Marilyn Excel Discussion (Misc queries) 1 November 18th 08 05:22 AM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" billybob Excel Discussion (Misc queries) 1 February 13th 06 03:14 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM
read from 1 cell read to and other using vba Henrik[_4_] Excel Programming 1 December 25th 03 06:15 PM


All times are GMT +1. The time now is 04:15 PM.

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"