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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Notepad in Excel in read only mode 1

Status
Not open for further replies.

kelqc

Programmer
Feb 16, 2003
31
0
0
AU
Hi

I use the following code to open a file with Notepad using Excel97.

Shell("C:\WINNT\Notepad.exe TossLogFile.txt", 1)

Is it possible to open the file in read only mode, I am trying to stop people from making any changes to it.

Thanks Kelvin
 
create a "dos"/command prompt batch file that contains both the attrib +r for this file and
the path and file name of the same.

then shell the batch file.


I.E.

create a file named my_notepad.bat that contains these lines...

attrib +r C:\WINNT\Notepad.exe TossLogFile.txt
C:\WINNT\Notepad.exe TossLogFile.txt

then in vba...

Shell("C:\WINNT\my_path\my_Notepad.bat", 1)

 
Hi ETID

Thanks for the help. I will give it a try

Kelvin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top