-
Open Notepad from Excel
Hello, new to this forum, but figured somebody here would be of help. I have written an Excel workbook and VBA file to manage inventory for the company I work for, I will be leaving this company in a few weeks and needed to leave some documentation/help files/how to on it so that the person who takes over my position can continue to use this file. So here's my question, I want to link to this file in my excel file (create a Command Button that when clicked will open this help file in Notepad). This help file is a .txt file, which I know I can open in excel but the formatting is shot when opened in Excel, does anyone know a way that VBA can open an external application like notepad? Thanks in advance. Ben
-
The shell function should do it:
Dim RetVal
RetVal = Shell("C:\WINDOWS\notepad.exe", 1)
2nd argument is window style - look up shell in the Help file for details.
-
Can I open a specific file say C:\myfile.txt in Notepad?
I tried Shell("C:\myfile.txt", 1) and it throws an error.
Thanks
-
I'd be more inclined to try something along the lines of:
RetVal = Shell("C:\WINDOWS\notepad.exe C:\myfile.txt", 1)
-
Thanks, that did exactly what I wanted it to do.