日期:2014-05-17  浏览次数:20907 次

ASP打印excel权限问题
<%
Response.Write   "正在打印报表...... <BR> "
strAdd   =   Application( "ASP_Directory ")& "chapter10\162 "
Set   fs   =   Server.CreateObject( "Scripting.FileSystemObject ")
if   fs.fileexists(stradd& "\ "&Session.SessionID& ".xls ")   then
      fs.DeleteFile(stradd& "\ "&Session.SessionID& ".xls ")
end   if
Set   xlApp   =   CreateObject( "Excel.Application ")    
Set   xlBook   =   xlApp.Workbooks.add       '打开工作表
Set   xlsheet   =   xlBook.WorkSheets(1)
Set   Conn   =   Server.CreateObject( "ADODB.Connection ")                                                    
Conn.ConnectionString   =   "Provider=Microsoft.Jet.OLEDB.4.0;Data   Source= "   &   strAdd& "\user.mdb "                        
Conn.Open                                                                                                                                    
Set   rs   =   Server.CreateObject( "ADODB.Recordset ")  
Sql   =   "Select   *   From   userinfo "
Set   rs   =   Conn.Execute(sql)
i   =   4
Do   While   not   rs.Eof
        xlSheet.cells(i,1).Value   =   rs( "username ")
        xlSheet.cells(i,2).Value   =   rs( "password ")
        rs.MoveNext
        i   =   i   +   1
Loop
rs.Close
Set   rs   =   Nothing      
xlSheet.Application.Visible   =   True  
xlBook.SaveAs   stradd& "\ "&Session.SessionID& ".xls "
xlApp.Quit
Set   xlApp   =   Nothing
Response.Write   "打印完成 "
Response.redirect   Session.SessionID& ".xls "
%>

错误类型:
Microsoft   VBScript   运行时错误   (0x800A0046)
没有权限:   'CreateObject '
/index1.asp,   第   8   行


我给了every和user,internet来宾用户修改和写入的权限了,还有什么权限要设置?

------解决方案--------------------
加Server.CreateObject( "Excel.Application ")