CreateObject(”Excel.Application”) is fail when run in web page.
CreateObject(”Excel.Application”) is fail when run in web page.
VB Script
<Script language=”vbscript”>
Dim objexcel
Set objExcel = createobject(”Excel.application”)? ? <———– This is where you fail to run
objexcel.Visible = True
objexcel.Workbooks.add
objexcel.Cells(1, 1).Value = “Test demo”
objexcel.ActiveWorkbook.SaveAs(”c:\testexcel.xls”)
objexcel.Quit
</SCRIPT>
VbScript run at client side every time when user open a web page.
Vbscript create the excel.application object and write data in the sheet and then after save this spreadsheet. These codes write in one html page. Run spreadsheet into your pc and you get fails to create excel object (excel.application object). This gives the message “activeX object couldn’t be created”
Solution for this error is
Set Browser Setting as below
Under trusted sites / security click Custom Level and enable Initalizing and Scripting ActiveX controls that are not marked safe. That should enable create
eobject on client.