Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to click on charts & unable to create any new charts Excel | Charts and Charting in Excel | |||
link excel charts to web pages and update charts automatically | Charts and Charting in Excel | |||
Charts - How to have multiple charts share a legend. | Charts and Charting in Excel | |||
Matching the colors Column Charts and Pie Charts | Charts and Charting in Excel | |||
URGENT - NEED PRO EXCEL PROGRAMMER - TO AUTOMATICALLY CHANGE TITLES IN EXCEL CHARTS | Excel Programming |