ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Control Notepad from Excel (https://www.excelbanter.com/excel-programming/312882-control-notepad-excel.html)

pete

Control Notepad from Excel
 
Does anyony know if it is possible to open a note pad
file from excel, enter in some information (All Text)
save the file as a specific name in a specific directory
on the users PC.

Basically what I want to do is this
Open notepad
write some text
save file as "something" in "somewhere"
close notepad
close excel
End

Any help would be appreciated.
Thanks
Pete

Juan Pablo González

Control Notepad from Excel
 
You don't need Notepad to do that. You can do that by using VBA's builtin
commands, like Open, Print # (or Write #), Close, etc.

--
Regards

Juan Pablo González

"Pete" wrote in message
...
Does anyony know if it is possible to open a note pad
file from excel, enter in some information (All Text)
save the file as a specific name in a specific directory
on the users PC.

Basically what I want to do is this
Open notepad
write some text
save file as "something" in "somewhere"
close notepad
close excel
End

Any help would be appreciated.
Thanks
Pete




pete

Control Notepad from Excel
 
Juan

It really does need to be in a notepad format. I have a
Notepad file .csv that is required to control another
program, or the other program (Visual Basic) is writen to
look for this file in order to perform the funtions
needed.

I have up update this notepad file everyweek and send
this off to 200 sales rep around the country. If they
don't install this notepad file in their PC their sales
reporting tools will not work.

Thanks
Pete
-----Original Message-----
You don't need Notepad to do that. You can do that by

using VBA's builtin
commands, like Open, Print # (or Write #), Close, etc.

--
Regards

Juan Pablo González

"Pete" wrote in

message
...
Does anyony know if it is possible to open a note pad
file from excel, enter in some information (All Text)
save the file as a specific name in a specific

directory
on the users PC.

Basically what I want to do is this
Open notepad
write some text
save file as "something" in "somewhere"
close notepad
close excel
End

Any help would be appreciated.
Thanks
Pete



.


Michel Pierron

Control Notepad from Excel
 
Hi Pete,
Shell "C:\WINDOWS\NOTEPAD.EXE", 1

MP

"Pete" a écrit dans le message de
...
Does anyony know if it is possible to open a note pad
file from excel, enter in some information (All Text)
save the file as a specific name in a specific directory
on the users PC.

Basically what I want to do is this
Open notepad
write some text
save file as "something" in "somewhere"
close notepad
close excel
End

Any help would be appreciated.
Thanks
Pete




Dave Peterson[_3_]

Control Notepad from Excel
 
The open/print#/close stuff writes to a plain old text file.

That's what NotePad uses.

Option Explicit
Sub testme()

Dim myFileName As String
Dim FileNum As Long

myFileName = "C:\my documents\excel\outfile.txt"

FileNum = FreeFile
Close FileNum
Open myFileName For Output As FileNum

Print #FileNum, "Here's some text"
Print #FileNum, "from A1: " & ActiveSheet.Range("a1").Text

Close FileNum
End Sub

Try this little example to see if it works (open the output file in NotePad).

Here are three sites that you could steal some code from:

Earl Kiosterud's Text Write program:
www.smokeylake.com/excel
(or directly: http://www.smokeylake.com/excel/text_write_program.htm)

Chip Pearson's:
http://www.cpearson.com/excel/imptext.htm

J.E. McGimpsey's:
http://www.mcgimpsey.com/excel/textfiles.html

Pete wrote:

Juan

It really does need to be in a notepad format. I have a
Notepad file .csv that is required to control another
program, or the other program (Visual Basic) is writen to
look for this file in order to perform the funtions
needed.

I have up update this notepad file everyweek and send
this off to 200 sales rep around the country. If they
don't install this notepad file in their PC their sales
reporting tools will not work.

Thanks
Pete
-----Original Message-----
You don't need Notepad to do that. You can do that by

using VBA's builtin
commands, like Open, Print # (or Write #), Close, etc.

--
Regards

Juan Pablo González

"Pete" wrote in

message
...
Does anyony know if it is possible to open a note pad
file from excel, enter in some information (All Text)
save the file as a specific name in a specific

directory
on the users PC.

Basically what I want to do is this
Open notepad
write some text
save file as "something" in "somewhere"
close notepad
close excel
End

Any help would be appreciated.
Thanks
Pete



.


--

Dave Peterson



All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com