Opening Notepad application from Excel macro

G

Guest

Hello,

How can I do the following:

- Open Note pad application from an excel macro
- Copy data from an excel worksheet into the newly opened Wordpad
- Save as a name and close the Wordpad file

Thanks!!
 
N

NickHK

Rafael,
Do you really need to use NotePad/WordPad ?
It would be easier to save you data as a .csv or .txt file.
Or write you own file with Open.
Or even use a Rich Text Box.

Depends what data/format you need, but using NotePad/WordPad should be your
last option.

NickHK
 
G

Guest

I agree with you. So How could I save a specific worksheet in excel in a txt
format, into a specific location? My data is in XML format and must be
exactly the same format as is in the excel worsheet because it will serve to
be input into another program which is very case sensitive.

I would be interested however, out of curiosity, to know how to do the long
the longer process I described previously.

Thanks!
 
N

NickHK

Excel 10 and up have built in support for XML.
Record a macro as you perform the save and see the code.

Would that work ?

NickHK
 
G

Guest

I had tried this method before but the macro does not record the procedures
once I ckick outside Excel.
What code should I use to get this process done automatically?
 
N

NickHK

Rafael,
Excel can only record actions within itself, not everywhere in Windows. It
will give you code to .SaveAs in XML format. What you with the generated
file is not a matter for Excel, although you can (probably) use VBA. Depends
what you are doing.
More details otherwise how can anyone answer

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top