473,408 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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
Jul 19 '05 #1
0 1149

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ian castleden | last post by:
From time to time I see requests for some sort of python MS Excel interface/software. I have written just such software 100% python (works with Jython too! at least it did a year ago). It was...
0
by: mscir | last post by:
Date: Thu, 08 Jul 2004 17:02:27 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <10ero4l3kp2qa65@corp.supernews.com> Reply-To: mscir@usa.com User-Agent: Mozilla/5.0...
10
by: Mark Day | last post by:
Hi All, I am using Access 2000 to generate over 40 Excel charts and pivot tables using early binding to the Excel 9.0 object library. I am finding that if I show the Excel object while processing...
0
by: Rach | last post by:
Hi, Does anyone know how to export charts/graphs from EXCEl into Powerpoint-Microsoft Charts though VBA code. I would like to import the underlying data with the chart as well. I know we can...
1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
5
by: Takeadoe | last post by:
I'm doubtful that the group is unbiased, but I will ask anyhow :o). If one intends to plot lots of data, primarily XY line and scatter plots, and mass produce them (in many cases I will be doing...
3
by: implicate_order | last post by:
Greetings, I'm new to python and am in the process of writing a script to parse some CSV data, spread it across multiple Excel worksheets and then generate charts. I searched the internet to...
3
by: saragoesnuts | last post by:
I have a program that automates to Excel with information in tables. I want to add charts to the excel file (pie charts, bar charts, etc). Is this possible?
0
by: eolmos | last post by:
Hello everyone, I am currently working on a project that requires a webform in asp.net using C# as the code behind. The page must allow the user to create a report in excel. This report must also...
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.