open .txt file from with vba

I found what I wanted by Jon Summers, but the link will not take you anywhere it errors out. It appeared just what I was looking for

If you do a keyin the %

Manual KeyIns work like: %"C:\Text_C\Text MicroStation\MouseWheelSettings.txt"

Sub Jiri01()
Dim RetVal
RetVal = Shell("C:\WINDOWS\notepad.exe ", 1)
ShowStatus "Open Notepad"
End Sub

But if you try the same thing from within VBA it will error out, been working for days on this simple thing.

even found the following , which did not work either!!

railab2008 said:
Maybe there is another way for opening text files?

There's another way to open files of any type from VBA.

This article describes Windows File Associations, and a utility that you can call from VBA to open a document using its associated application.  That is, you can open a Word, Excel, Text or whatever document.

Regards, Jon Summers
LA Solutions

Parents Reply Children
No Data