I'm developing a web-application with ASP which retrieves data from the database. The server is WinNT 4.0 Server, IIS4.0 and SQL Server 7.
It passes the data to Microsoft Excel 2000 which is embedded to Internet Explorer.
The problem is that I get data to Excel pretty fine, but the problem is that the script should create a chart automatically from the data got from the database.
I've tried to use the following code to generate the chart (It works pretty fine when running as Excel macro), but it does not show the chart (and doesn't show any errors):
<%
Set MyExcelChart = CreateObject("Excel.Sheet"
MyExcelChart.ActiveSheet.Name = "Object 1"
MyExcelChart.Application.Visible = True
MyExcelChart.ActiveSheet.Range("a2:b4"

.Select
MyExcelChart.Charts.Add
MyExcelChart.ActiveChart.ChartType = 97
MyExcelChart.ActiveChart.BarShape = 3
MyExcelChart.ActiveChart.HasTitle = True
MyExcelChart.ActiveChart.ChartTitle.Text = "AutoChart"
MyExcelChart.ActiveChart.SetSourceData MyExcelChart.Sheets("Object 1"

.Range("a2:b4"

, PlotBy = 1
MyExcelChart.ActiveChart.Location 1
'MyExcelChart.ActiveChart.Location 1
MyExcelChart.ActiveChart.HasDataTable = True
MyExcelChart.ActiveChart.DataTable.ShowLegendKey = True
%>
Another problem is that the script names the Excel workbook randomly from some reason. I've queries stored to the database from where the script gets the SQL and produces graph.
If you have any suggestions (examples) or ideas how to implement this, I would appreciate it. I've tried to find example from the net few days but found nothing.
Thank you!