Open Notepad and Put Data

Faiek

New Member
Joined
May 2, 2011
Messages
48
Hi,
I would like to make a button that opens the notepad.exe and then pastes data from different textboxes on a userform on that open notepad window. Can anybody help with this?

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
For instance, use this to write data to the file C:\test.txt:

Code:
    Open "C:\test.txt" For Output As #1
    Print #1, Me.TextBox1.Text
    Close #1

The textbox is called TextBox1 in this example.
 
Upvote 0
Do you have a need to use specifically Notepad.exe or are you looking for a way to save your textbox.text to a text file?
 
Upvote 0
Do you have a need to use specifically Notepad.exe or are you looking for a way to save your textbox.text to a text file?

I'm looking for a way to save it to a textfile. Wigi's solution is almost correct, But in the code I would like to create a textfile and let the user name it then save it.
 
Upvote 0
The Inputbox function is often used in other threads.

Code:
    Open Application.InputBox("please specify file and path", Type:=2) For Output As #1
    Print #1, Me.TextBox1.Text
    Close #1
 
Upvote 0
The Inputbox function is often used in other threads.

Code:
    Open Application.InputBox("please specify file and path", Type:=2) For Output As #1
    Print #1, Me.TextBox1.Text
    Close #1

Can you please explain this? I can't seem to get it working.
 
Upvote 0
What happens when you execute it?
 
Upvote 0
It opens the input window, but when I put in the path and name it doesn't create the file? Does this code actually include the file creation part because from what I see it doesn't.
 
Upvote 0
Yes, it does. What is the path and filename you type into the box/input window?
 
Upvote 0
Oh My Mistake, I got it working now. Thanks So much. One other question is there a way to make the Save as dialog appear instead to make it more convenient for the end-user?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top