Making an Excel macro interact with another application

Hi all.

I’m trying to cook up an Excel document that take’s a user’s input and converts it into something for use with a program I’m writing.  So far, it works fine, but now I want to make a macro where when you click a button, it copies the text, opens Notepad, pastes the data in there, and then saves it with a specific filename in the same directory as the Excel document.  Does anyone have any idea how to do this?

It can do that? Your Excelfu is strong.

Here’s what you do:

  1. Highlight the text you want copied.
  2. Hit control+c
  3. Open Notepad.
  4. In your notepad file, hit control+v.
  5. Go up to file then go down to save then select the directory that the excel document is in and hit ok.
  6. Profit.

Well, thanks for the infromation.  Unfortunately, I can do that already.  What I need is to find a way to make a macro do that with a click of a button (if it’s even possible).  I tried just using the macro record feature, but as soon as I click out of Excel, the macro stops recording.  Basically, I need to use VBA to do the job from there.  Can VBA open Word, paste text into a doc, and then save it as a plaintext (ASCII) file?

I don’t even think its possible.