If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Changing Chart Source Data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-25-04, 16:36
madhavi28 madhavi28 is offline
Registered User
 
Join Date: Jun 2004
Posts: 39
Question Changing Chart Source Data

Hi,
Actually I'm exporting data from access database to excel workbook automatically. I have done many calculations to the data. But now the problem is there is a chart in the workbook and I need to add my new data which is one row to the chart's source data.
Can anyone help me out with any functions relating to charts that can be coded in access.
Thanks.
Reply With Quote
  #2 (permalink)  
Old 06-30-04, 14:30
madhavi28 madhavi28 is offline
Registered User
 
Join Date: Jun 2004
Posts: 39
anyone help me out.its urgent
Reply With Quote
  #3 (permalink)  
Old 06-30-04, 15:43
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Hi madhavi

are you doing this automatically then you can use

ActiveChart.SetSourceData (Rangeobject of source data)
this will rebuild your chart for you

if your coming from access you will need to qualify it fully such as

worksheets("Chartsheet").charts(1).setsourcedata newrange

with newrange as a previously devised range that you have got
try running your code for the chart in excel before transfering to Access

I havn't tested this so if it doesn't work properly let me know of the problems

David
Reply With Quote
  #4 (permalink)  
Old 06-30-04, 16:40
madhavi28 madhavi28 is offline
Registered User
 
Join Date: Jun 2004
Posts: 39
This code worked out for me.Í'm doing it from access and the chart is not activating. so i had to use chartobjects to activate it. I used the following code.

appxl.Worksheets(1).ChartObjects("chart 1").Activate

appxl.ActiveChart.SetSourceData (appxl.ActiveSheet.Range(appxl.ActiveSheet.Cells(b eginrow,begincol), appxl.ActiveSheet.Cells(endROW,endcol)))

Thanks for your reply.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On