LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel charts on the fly with ASP

I have a script which creates an excel workbook, dumps a load of data into
it and calls the following code. The ranges are created from a query and
relate to the data that has just been added to the workbook.

xlApplication.Sheets("Sheet1").Select
xlApplication.ActiveSheet.Range("A1:A10,C1:C10:D1: D10,F1:F10").Select
xlApplication.Charts.Add
xlApplication.ActiveChart.SetSourceData
xlApplication.Sheets("Sheet1").Range("A1:A10,C1:C1 0:D1:D10,F1:F10"), 2
xlApplication.ActiveChart.Location 1
xlApplication.ActiveChart.HasDataTable = True
xlApplication.ActiveChart.DataTable.ShowLegendKey = True
xlApplication.ActiveChart.HasTitle = True
xlApplication.ActiveChart.ChartTitle.Characters.Te xt = strGraphTitle
xlApplication.ActiveChart.DisplayBlanksAs = 3
xlApplication.ActiveChart.PlotVisibleOnly = True
xlApplication.ActiveChart.Name = strChartTabName

A1:A10 contain the x-axis data and the rest of the ranges are plotted on the
chart. All ranges are of the same type [i.e. number or currency or time
etc...]

The excel file is then saved and opened in a web browser.

At first I thought that it was working really well, but excel gets confused
when the data is in a time format. For some reason this screws up the chart.
Closer inspecting shows that the data ranges are overridden and the chart is
meaningless.

Strangely, if I record a macro in excel [which produces equivalent vb code]
that plots the same chart on the data I get the same result.

Could this be a quirk of excel or is there something glaringly obvious that
I have missed.

Many thanks in advance.
Steve



 
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
Unable to click on charts & unable to create any new charts Excel Snapclick Charts and Charting in Excel 4 February 1st 09 07:59 PM
link excel charts to web pages and update charts automatically Signguy Charts and Charting in Excel 1 April 22nd 08 08:29 PM
Charts - How to have multiple charts share a legend. Sean Charts and Charting in Excel 2 November 20th 07 04:49 AM
Matching the colors Column Charts and Pie Charts RohanSewgobind Charts and Charting in Excel 3 April 21st 06 09:35 PM
URGENT - NEED PRO EXCEL PROGRAMMER - TO AUTOMATICALLY CHANGE TITLES IN EXCEL CHARTS Marcello do Guzman Excel Programming 2 October 7th 03 05:11 PM


All times are GMT +1. The time now is 02:16 PM.

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"