S
Steve Richter
running a simple vbscript in an .htm page that starts excel and loads
the spreadsheet with the contents of a <table> ... </table>
getting an "Error: ActiveX component cant create object.
Excel.Application" error.
<script language="vbscript">
Sub TableToExcel_onclick
Dim sHTML, oExcel, oBook
sHTML = document.all.item("DataGrid1").outerHTML
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML
oBook.HTMLProject.RefreshDocument
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>
This script works when when I navigate to the .htm file via a c: drive
physical path:
c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm
but it fails with the above described message when I navigate to it
via:
http://localhost/demosite/VbScript1.htm
I dont think it is a permission issue because I gave ASPNET, the IIS
user on my system, administrator rights, just to rule that possiblity
out.
any ideas why my script fails to CreateObject( 'Excel.Application' )??
thanks,
-Steve
the spreadsheet with the contents of a <table> ... </table>
getting an "Error: ActiveX component cant create object.
Excel.Application" error.
<script language="vbscript">
Sub TableToExcel_onclick
Dim sHTML, oExcel, oBook
sHTML = document.all.item("DataGrid1").outerHTML
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML
oBook.HTMLProject.RefreshDocument
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>
This script works when when I navigate to the .htm file via a c: drive
physical path:
c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm
but it fails with the above described message when I navigate to it
via:
http://localhost/demosite/VbScript1.htm
I dont think it is a permission issue because I gave ASPNET, the IIS
user on my system, administrator rights, just to rule that possiblity
out.
any ideas why my script fails to CreateObject( 'Excel.Application' )??
thanks,
-Steve