Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a read only text file using VBA

Status
Not open for further replies.

Klopper

MIS
Dec 7, 2000
84
US
Quick question:

I have a coded a small procedure to extract data from a MS Excel 97 to a new .txt file. Is there any way to set this new text file as read only?

Thanks in advance for any suggestions,
Klopper
 
Hmmmmmmmmmmmm,

Of course it can be done. If you write the file, you MUST know it's path and name, so making it read only is just playing with the attributes.

But then, it is ONLY playing, as is it less than child's play to undo this.

If you want to "protect" your precious text, you need to put is some where that has at least a modicum of security, like at least a password and within some organiziation which will not be casually moved to the 'recycle bin' by anyone.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I would extract the file to a read-only folder.

"The reward of one duty done is the power to fulfill another"
<%
Jr_Clown@Yahoo.com
%>
 
Thanks for the response!

Michael:
Bearing in mind that I use the &quot;Open DestFile For Output&quot; VBA statement in Excel 97 (where DestFile is the full path, file name and file extension), how would I set the property of this new .txt file to read only?
i.e. How would I &quot;play with the attributes&quot; programmatically?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top