Create a chart with ASP

  • Thread starter Thread starter Ingo R. Kirchner
  • Start date Start date
I

Ingo R. Kirchner

Hi Folks,

I try to create a chart via vbscript in asp, it worked finde in my IIS, but
on another machine it crashed at SeriesCollection, saying this property is
not supported:
any help appreciated
thanks in advance

ingo

Dim xlApp, xlBook, xlSheet, xlRange
Set xlApp = Server.CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
xlApp.Application.Visible = False
xlBook.Sheets.Add
xlBook.ActiveSheet.Name = "a"
xlBook.Sheets("a").Cells(1,1).Value = "d"
xlBook.Sheets("a").Cells(2,1).Value = "e"
xlBook.Sheets("a").Cells(3,1).Value = "f"
xlBook.Sheets("a").Cells(4,1).Value = "g"
xlBook.Sheets("a").Cells(5,1).Value = "h"
xlBook.Sheets("a").Cells(1,2).Value = Session("E202")
xlBook.Sheets("a").Cells(2,2).Value = Session("E202_1")
xlBook.Sheets("a").Cells(3,2).Value = Session("E203")
xlBook.Sheets("a").Cells(4,2).Value = Session("E207")
xlBook.Sheets("a").Cells(5,2).Value = Session("E210")
Set xlRange = xlBook.Sheets("a").Range("A1:B5")
Set xlChart = xlBook.Sheets("a").ChartObjects.Add(20, 20, 644, 402)
xlChart.Chart.ChartWizard xlRange, -4102, , 2, 1, 0, False
xlChart.Chart.ChartType = 70
xlChart.Chart.HasTitle = False
xlChart.Border.Weight = 2
xlChart.Border.LineStyle = 0
xlChart.Chart.SeriesCollection(1).DataLabels.ShowPercentage = False
xlChart.Chart.SeriesCollection(1).DataLabels.ShowCategoryName = True
xlChart.Chart.SeriesCollection(1).DataLabels.ShowValue = False
xlChart.Chart.SeriesCollection(1).HasLeaderLines = True
 
What does column B contain on the different servers? Does it have
numeric data on the server where you have problems? Do you get a
legitimate plot after the ChartWizard method? Are the OWC on the
different servers the same (version)?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Microsoft MVP -- Excel
 
Hi Tushar,

thanks for your answer. Column A contains the description and column B
contains the amount. So I want to create a exploded pie chart for five
amounts, which worked fine on my machine, but not on another the mentioned
error message came up.

like

A B
food 385
rent 250
car 150
insurance 75
taxes 210

any idea whats wrong with the code

thanks a lot

Ingo
 
Back
Top