Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening and saving textfile into XLS
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening and saving textfile into XLS
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 "MicMast" wrote in message om... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
opening and saving a workbook | Excel Discussion (Misc queries) | |||
Default folder for opening/saving files | Excel Discussion (Misc queries) | |||
Workbook slow opening & saving | Excel Discussion (Misc queries) | |||
WHEN DOWNLOADING A TEXTFILE EXCEL DELETES BLANK ROWS - STOP THIS? | Excel Worksheet Functions | |||
Excel VBA to access URL as Textfile | Excel Programming |