automating chart generation from text files

  • Thread starter Thread starter druid77
  • Start date Start date
D

druid77

Hi,
I am new to the world of Excel automation, and I need to
accomplish the following:

I have a text file containing a row of data on each line (each column
is delimited by a space). I need to automate the import of this data
into a corresponding excel spreadsheet, and the generation of a graph
from the spreadsheet. This task needs to be run once a day
automatically, getting data from the text file. Preferably as little
human interaction as possible should take place. Currently I already
have the excel spreadsheet template that contains the graph, I just
need a way to automated the input process, so I don't have to cut and
paste the data into the sheet everyday by hand.

The best case situation would be as follows:

1. The text file gets automatically updated once a day (I have already
done this part).

2. The excel automation (described above) would be kicked off after the
text file is updated.

3. Step 2 should produce as output the xls file corresponding the the
tables and the graph.

Any help would be greatly appreciated. THanks!
 
by the way... I'm not looking for specific code here (well it would be
nice but I'm not really expecting that much).. RAther a general plan of
attack (high-level view of how to solve this porblem) would be nice.
Thanks
 
Wouldn't this do what you need ? It imports a text file and draws a graph
from it...
ST

Sub Graph()
' Graph Macro
' Macro recorded 04-10-2003 by Sérgio Terenas
'
Workbooks.OpenText Filename:="C:\data.txt", Origin:=437, StartRow:=1, _
DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(8, 1)),
_
TrailingMinusNumbers:=True
Range("A1:B11").Select
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"B&W Line - Timescale"
ActiveChart.SetSourceData Source:=Sheets("data").Range("A1:B11"),
PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="data"
End Sub
 
Back
Top