ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   automating chart generation from text files (https://www.excelbanter.com/excel-programming/278724-automating-chart-generation-text-files.html)

druid77

automating chart generation from text files
 
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!



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


druid77[_2_]

automating chart generation from text files
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Sergio Terenas

automating chart generation from text files
 
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 Whe=xlLocationAsObject, Name:="data"
End Sub


"druid77" wrote in message
...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com