Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't open object using .aspx file. Can open with .htm file 1

Status
Not open for further replies.

sabev

Programmer
Sep 27, 2002
47
US
I’m trying to use vbScript to open an excel application (I’m also going to do word).


Sub Btn1_onclick()
call OpenWorkbook("c:\temp\test.xls")
End Sub

Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open strLocation
objExcel.UserControl = true
End Sub

This code works in a .HTM file but not an .aspx file.

I get this error -

Microsoft VBScript runtime error: ActiveX component can't create object: 'Excel.Application'

Why wouldn't it work in an .aspx file?


 
Try asking this question in the ASP.Net forum. Aspx files are .Net driven, and they ought to be able to help you there.
 
Thanks, I fiqured it out. It was a browser security issue when run in debugger.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top