Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Start me in the right direction, please

I'm NOT a programmer, but...

this *shouldn't* be too difficult, even for me.

An input file I create for another program is a text file. Most of the lines
are the same with every run. My goal is to use Excel to "pre-process" that
input file and then save it.

Can someone either tell me:
a.) the command structure for a routine to do this or,
b.) give me a good reference so that I don't spend my time going down the
wrong path?

Of course, the next step would be to execute that other program from within
Excel and then bring back the results into my spreadsheet, but I'm getting
ahead of myself.

TIA,

Bill


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Start me in the right direction, please

Bill,

If I understand you correctly, you want to use Excel to read or create and then
save a text file for input to another program.

To import a text file into Excel, just use the File -- Open... menu path, and
select "All Files (*.*)" in the "Files of type" drop-down list. The Text
Import Wizard will pop up and guide you through the steps.

To save a worksheet as a text file, use the File -- Save as... menu path, and
select one of the several text options in the "Save as type" drop-down list.

Regards,
Wes
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Start me in the right direction, please

Hi Bill
you may provide some more details :-)
BUT in general I won't use Excel to create a text file. You may
consider a scripting language like PERL but this depends on what you're
really trying to do

--
Regards
Frank Kabel
Frankfurt, Germany


Bill Allen wrote:
I'm NOT a programmer, but...

this *shouldn't* be too difficult, even for me.

An input file I create for another program is a text file. Most of
the lines are the same with every run. My goal is to use Excel to
"pre-process" that input file and then save it.

Can someone either tell me:
a.) the command structure for a routine to do this or,
b.) give me a good reference so that I don't spend my time going down
the wrong path?

Of course, the next step would be to execute that other program from
within Excel and then bring back the results into my spreadsheet, but
I'm getting ahead of myself.

TIA,

Bill


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Start me in the right direction, please

Thanks, Frank.

But, I _really_ do want to use Excel.
Two reasons:
1. I want to use Excel for preprocessing purposes.
2. I don't know Perl (or just about anything else, for that matter,
besides enough VB to get me in trouble).

I *think* I've found out how to do what I want.
Tell me what you think:

Public Sub CreateFile()
Open ThisWorkbook.Path & "\example.txt" For Output As #1
Print #1, "Blah, blah, blah"
Print #1, "Blah, blah, blah"
Print #1, "Blah, blah, blah"
..
..
..
'the "Blah, blah, blah" lines are those that don't change from one file to
the other. No reason to put them in the spreadsheet.)
..
..
..
Print #1, Format(Str(Range("C4").Value), "#.0"); " ";
Print #1, Format(Str(Range("C5").Value), "#.0"); " ";
Print #1, "0.0"
..
..
..
'these are the parts of the input file which change. Cells C4 and C5 have
the values formatted properly to be read by the other program.
..
..
..
Close #1
End Sub

Anything wrong with that?

Thanks,
Bill

"Frank Kabel" wrote in message
...
Hi Bill
you may provide some more details :-)
BUT in general I won't use Excel to create a text file. You may
consider a scripting language like PERL but this depends on what you're
really trying to do

--
Regards
Frank Kabel
Frankfurt, Germany


Bill Allen wrote:
I'm NOT a programmer, but...

this *shouldn't* be too difficult, even for me.

An input file I create for another program is a text file. Most of
the lines are the same with every run. My goal is to use Excel to
"pre-process" that input file and then save it.

Can someone either tell me:
a.) the command structure for a routine to do this or,
b.) give me a good reference so that I don't spend my time going down
the wrong path?

Of course, the next step would be to execute that other program from
within Excel and then bring back the results into my spreadsheet, but
I'm getting ahead of myself.

TIA,

Bill




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Start me in the right direction, please

Hi Bill
if this works for you than yout go with it :-)
Nothing wrong with the code.

--
Regards
Frank Kabel
Frankfurt, Germany


Bill Allen wrote:
Thanks, Frank.

But, I _really_ do want to use Excel.
Two reasons:
1. I want to use Excel for preprocessing purposes.
2. I don't know Perl (or just about anything else, for that

matter,
besides enough VB to get me in trouble).

I *think* I've found out how to do what I want.
Tell me what you think:

Public Sub CreateFile()
Open ThisWorkbook.Path & "\example.txt" For Output As #1
Print #1, "Blah, blah, blah"
Print #1, "Blah, blah, blah"
Print #1, "Blah, blah, blah"
.
.
.
'the "Blah, blah, blah" lines are those that don't change from one
file to the other. No reason to put them in the spreadsheet.)
.
.
.
Print #1, Format(Str(Range("C4").Value), "#.0"); " ";
Print #1, Format(Str(Range("C5").Value), "#.0"); " ";
Print #1, "0.0"
.
.
.
'these are the parts of the input file which change. Cells C4 and C5
have the values formatted properly to be read by the other program.
.
.
.
Close #1
End Sub

Anything wrong with that?

Thanks,
Bill

"Frank Kabel" wrote in message
...
Hi Bill
you may provide some more details :-)
BUT in general I won't use Excel to create a text file. You may
consider a scripting language like PERL but this depends on what
you're really trying to do

--
Regards
Frank Kabel
Frankfurt, Germany


Bill Allen wrote:
I'm NOT a programmer, but...

this *shouldn't* be too difficult, even for me.

An input file I create for another program is a text file. Most of
the lines are the same with every run. My goal is to use Excel to
"pre-process" that input file and then save it.

Can someone either tell me:
a.) the command structure for a routine to do this or,
b.) give me a good reference so that I don't spend my time going
down the wrong path?

Of course, the next step would be to execute that other program

from
within Excel and then bring back the results into my spreadsheet,
but I'm getting ahead of myself.

TIA,

Bill


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Direction CmK New Users to Excel 3 July 3rd 07 12:04 AM
Need direction CmK Excel Discussion (Misc queries) 4 July 2nd 07 04:48 PM
OT :Start your own online business today !start making dollars [email protected] Excel Discussion (Misc queries) 0 May 6th 06 09:29 PM
I need direction Reluctantputerhead Excel Discussion (Misc queries) 3 November 2nd 05 12:42 AM
Start spreadsheet with WinXP start Gordon Gradwell Excel Worksheet Functions 1 July 13th 05 11:35 AM


All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"