Opening and saving textfile into XLS

  • Thread starter Thread starter MicMast
  • Start date Start date
M

MicMast

Hey reader,

I'm trying to make a chart of a few txt files.
I can open the txt files using:
logtext = InputBox("Give the name of the file to add", "Name of the
LogFile")
logfile = ThisWorkbook.Path & "\" & logtext & ".txt"
Workbooks.OpenText FileName:=logfile, _
Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited,
TextQualifier:= _
xlNone, ConsecutiveDelimiter:=True, Tab:=False, Semicolon:=False
_
, Comma:=False, Space:=True, Other:=False, OtherChar:=False

but that opens the txt file and them puts everything in the right
colums and rows. But now I want to save it as an .xls

I tried using thisworkbook.save(path of the file)
but then I saved the file where the button is standing to read the
log...
any ideas?

And one more thing, how do I use the data in the txtfile to make a
chart?
Thx in advance
micmast
 
thisworkbook.save "C:\my path\logtext.xls", xlWorkbookNormal

Turn on the macro recorder and create your graph manually. That should give
you a good start.

Regards,
Tom Ogilvy
 
Back
Top