<%@ LANGUAGE="VBSCRIPT" %> <% 'Delete the existing excel file for charting nd dim fs1,f set fs1=Server.CreateObject("Scripting.FileSystemObject") If (fs1.FileExists("C:\test1\a2.xls"))=true Then 'Response.Write("1.Exists.") set f=fs1.GetFile("C:\test1\a2.xls") f.Delete else 'Response.Write("1.note.") end if Set MyExcelChart = Server.CreateObject("Excel.Sheet") MyExcelChart.ActiveSheet.Range("B2:k2").Value = Array("Week1", "Week2", "Week3", "Week4", "Week5", "Week6", "Week7", "Week8", "Week9", "Week10") MyExcelChart.ActiveSheet.Range("B2:C2").Value = Array("Nov-04","Oct-04") MyExcelChart.ActiveSheet.Range("B3:k3").Value = Array("67", "87", "5", "9", "7", "45", "45", "54", "54", "10") MyExcelChart.ActiveSheet.Range("B3:C3").Value = Array("67", "87") MyExcelChart.ActiveSheet.Range("B4:k4").Value = Array("10", "10", "8", "27", "33", "37", "50", "54", "10", "10") MyExcelChart.ActiveSheet.Range("B4:C4").Value = Array("10", "10") MyExcelChart.ActiveSheet.Range("B5:k5").Value = Array("23", "3", "86", "64", "60", "18", "5", "1", "36", "80") MyExcelChart.ActiveSheet.Range("B5:C5").Value = Array("23", "3") MyExcelChart.Charts.Add p=1 q=1 'Format the chart, set type of chart, shape of the bars, show title, get the data for the chart MyExcelChart.activechart.ChartType = 107 MyExcelChart.activechart.BarShape = xlBox MyExcelChart.activechart.SetSourceData MyExcelChart.Sheets("Sheet1").Range("A" & p & ":k" & q),1 MyExcelChart.activechart.HasTitle = True MyExcelChart.activechart.ChartTitle.Text = "Test Charting..." MyExcelChart.activechart.SetSourceData MyExcelChart.Sheets("Sheet1").Range("A" & p & ":k" & q),1 MyExcelChart.ActiveChart.Legend.Delete 'MyExcelChart.ActiveChart.Legend.Height = 0 MyExcelChart.ActiveChart.PlotArea.Height = 60 MyExcelChart.ActiveChart.PlotArea.Width = 70 '''MyExcelChart.activechart.ChartArea.Clear ''' MyExcelChart.activechart.Axes(1, 1).HasTitle = True ''' MyExcelChart.activechart.Axes(1, 1).AxisTitle.Characters.Text = "8686Months" ''' MyExcelChart.activechart.Axes(1, 1).BaseUnit = 1 ''' MyExcelChart.activechart.Axes(1, 1).BaseUnitIsAuto = False 'Save the the excelsheet to chart.xls MyExcelChart.SaveAs "c:\test1\a2.xls" Set MyExcelChart = Nothing %> MyExcel Chart Excelsss##