Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 192
Default Creating a chart while data is being written to file!!!

Alrite,

I have a slight problem whereby I dont have a clue where to start.

I have an external source creating a .csv file and I would like to produce a
graph in Excel while the data is being written to the file. All it is, is
Column A being plotted against Column B.

Does any1 know if this can be achieved with VBA???

Thanks a lot

Nick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Creating a chart while data is being written to file!!!

Hi Nick,

I have a slight problem whereby I dont have a clue where to start.

I have an external source creating a .csv file and I would like to produce a
graph in Excel while the data is being written to the file. All it is, is
Column A being plotted against Column B.

Does any1 know if this can be achieved with VBA???


Sure, and probably without VBA!

Start by getting the data into the workbook, without locking the file. The
easiest way to do that is with Data Import External Data Import Data.
Change the 'Files of Type' to All files, browse to the csv file and OK through
the dialogs. When done, you should end up with both columns in the sheet. If
you want, you can right-click inside the data area, choose 'Data Range
Properties', give it a meaningful name (e.g. qryMyData) and tell it to refresh
every minute or so.

Now create a chart based on the data range. If you'd like the chart to
automatically expand as the new data is added, you can create two named ranges
to link the chart to the data, using Insert Name Define:

Name: ChtA
Refers To: =OFFSET(qryMyData,0,0,,1)

Name: ChtB
Refers To: =OFFSET(qryMyData,0,1,,1)

(Note that the qryMyData defined name is automatically created in the first
step, as the name you gave to the query range).

then use these names in the =SERIES() formula for the chart:

=SERIES("My Data",Book1.xls!ChtA,Book1.xls!ChtB,1)


Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


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
RECOVER OVER WRITTEN FILE jt Excel Discussion (Misc queries) 2 May 30th 10 03:39 AM
Error when creating a stock chart from data in .CSV file Curious[_2_] Excel Discussion (Misc queries) 9 April 16th 08 02:20 AM
Cube file could not be written. soppy_skyblue[_2_] Excel Discussion (Misc queries) 0 January 3rd 08 02:35 AM
Creating data for a chart DavidS Charts and Charting in Excel 4 December 2nd 06 06:31 PM
Save a file and send as an email - written into macro Louise Semaj Excel Programming 1 October 22nd 03 02:19 AM


All times are GMT +1. The time now is 12:25 AM.

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

About Us

"It's about Microsoft Excel"