Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Text File in Excel
I have a text file called Names.txt (stored at G:\Employees\Names.txt) that I
use to populate a combo box in an Excel form. The last choice in this list is "-Name Not Listed-". I instruct the users of the form to choose this if the desired employee name is not listed and click OK. Upon clicking OK, my code currently checks to see if that choice was made. If it is, I want the Names.txt text file to open (in Notepad) so that they can add the name so it's available next time they use the form. I'm struggling with the code that will open the file in Notepad. Thanks! -- Steve C |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Text File in Excel
Try:
Shell "G:\Employees\Names.txt" That should open the file in the machine's default text editor. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Text File in Excel
Sub opennotepad()
returnedvalue = Shell("C:\WINDOWS\notepad.exe \G:\Employees\Names.txt", 1) End Sub "Steve C" wrote: I have a text file called Names.txt (stored at G:\Employees\Names.txt) that I use to populate a combo box in an Excel form. The last choice in this list is "-Name Not Listed-". I instruct the users of the form to choose this if the desired employee name is not listed and click OK. Upon clicking OK, my code currently checks to see if that choice was made. If it is, I want the Names.txt text file to open (in Notepad) so that they can add the name so it's available next time they use the form. I'm struggling with the code that will open the file in Notepad. Thanks! -- Steve C |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Text File in Excel
oops typo
returnedvalue = Shell("C:\WINDOWS\notepad.exe G:\Employees\Names.txt", 1) "Mike" wrote: Sub opennotepad() returnedvalue = Shell("C:\WINDOWS\notepad.exe \G:\Employees\Names.txt", 1) End Sub "Steve C" wrote: I have a text file called Names.txt (stored at G:\Employees\Names.txt) that I use to populate a combo box in an Excel form. The last choice in this list is "-Name Not Listed-". I instruct the users of the form to choose this if the desired employee name is not listed and click OK. Upon clicking OK, my code currently checks to see if that choice was made. If it is, I want the Names.txt text file to open (in Notepad) so that they can add the name so it's available next time they use the form. I'm struggling with the code that will open the file in Notepad. Thanks! -- Steve C |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Text File in Excel
Thanks for the help!
-- Steve C "Mike" wrote: oops typo returnedvalue = Shell("C:\WINDOWS\notepad.exe G:\Employees\Names.txt", 1) "Mike" wrote: Sub opennotepad() returnedvalue = Shell("C:\WINDOWS\notepad.exe \G:\Employees\Names.txt", 1) End Sub "Steve C" wrote: I have a text file called Names.txt (stored at G:\Employees\Names.txt) that I use to populate a combo box in an Excel form. The last choice in this list is "-Name Not Listed-". I instruct the users of the form to choose this if the desired employee name is not listed and click OK. Upon clicking OK, my code currently checks to see if that choice was made. If it is, I want the Names.txt text file to open (in Notepad) so that they can add the name so it's available next time they use the form. I'm struggling with the code that will open the file in Notepad. Thanks! -- Steve C |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel open file as text | New Users to Excel | |||
open text file in excel | Excel Worksheet Functions | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
Open two text file in Excel | Excel Programming | |||
Open delimited text file to excel without changing data in that file | Excel Programming |