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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set permissions to create an Excel application object

Status
Not open for further replies.

glenmac

Technical User
Jul 3, 2002
947
CA
I am trying to open a csv file (which opens in excel). When I run the asp page it gives me "Permission denied: 'CreateObject'
/openExcelTest.asp, line 14" error. I can open a text file in the same directory with no problems. Is there a place I can alow webuser to create an object? the code looks right to me but it won't let me create an excel application object. It is probably very simple but I can't get it to work. All help would be greatly appreciated. Folowing is my code.

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<% Language=VBScript %>
<html>
	<head><title>Get Excel File</title>
	</head>
   
<body bgcolor=&quot;#333399&quot;  text=&quot;#CCCCCC&quot; link=&quot;#009900&quot; vlink=&quot;#0099CC&quot;>
<h2>These Items have been ordered</h2>


<%dim objExcel
sub openExcel()
set objExcel = CreateObject(&quot;Excel.Application&quot;)
objExcel.Workbooks.Open(&quot;c:\274\Order.csv&quot;)
objExcel.Visible = True
end sub
call openExcel%>
</body></html>
 
A quick and dirty way to do it would be to open the excel on the clients machine. The way your are doing, you are trying to instantiate an object of the excel on your server onto the clients window. Not just bad for security, but bad as far as server load and transfer time.
To open the file on the clients machine (9 times out of 10, darn people that are using 5 year old browsers) just link to the excel file and target it to _blank like you would a popup window, the browser should load excel on the clients machine to open the file from your server.
-Tarwn
 
Thanks a ton Tarwin works like a charm!!! I can't believe how stupid I was!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top