View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default VBA text file to .xls

Personally, I think you'd be better served to create a single .xls file (you do
the importing of the text file into the project). Then you can share that
workbook with the end users.

Chip Pearson has some code that shows how to do this import:
http://www.cpearson.com/excel/vbe.htm

(I think the extra minutes you spend doing the work once will pay for itself in
time saved from not having to answer questions about why something didn't work.)


wrote:

Suppose I were to create a text file containing VBA using
some text processing program (not connected with VBA, Excel,
etc.). The VBA program that is output, when run in Excel
will create a spreadsheet data and all. This would be done
on a regular basis, i.e. its not a one time item.

What is the easiest procedure to tell a user in order to give
them the VBA text file so that they can read it in and run it.
They are not necessarily sophisticated so its preferable
if they have minimal effort to do this. Also note that the
VBA text file may be long.

What I really want is something like
File | Open | select the VBA text file
and it gets read in and executed but I assume that that would
not work.

One other possibility is that to produce a procedure to
automatically read in the text file, execute the read-in VBA
program and then save it as an .xls file (without the VBA
program that generated it). In this case one could just
give the .xls file to the user. Since this is all done on
a regular basis this reading in and saving would have to be
done without manual intervention.


--

Dave Peterson