Click to See Complete Forum and Search --> : cannot create excel application


kwmlok
02-20-2003, 12:35 AM
I have the following code to create excel application in NT Server, MS Office has been installed, but i still get error in createobject (excel.application), any ideas???
Urgent!
thx.

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Provider = "Microsoft.Jet.OLEDB.4.0"
oConn.Open(Server.MapPath("test.mdb"))
set rs=oConn.Execute("select * from customer")
response.write(rs("cust_code").value)

'Create a new workbook in Excel
Dim oExcel
Dim oBook
Dim oSheet
Set oExcel = Server.CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
Set oSheet = oBook.Worksheets(1)

'Transfer the data to Excel
oSheet.Range("A1").CopyFromRecordset rs

'Save the Workbook and Quit Excel
oBook.SaveAs "Mytest.xls"
oExcel.Quit

'Close the connection
rs.Close
oConn.Close

kwmlok
02-20-2003, 02:41 AM
I am getting this error for the create excel object in previous message:

Server object error 'ASP 0177 : 80080005'

Server.CreateObject Failed

/test/mytest.asp, line 32

Server execution failed

Any ideas?