本文介绍了由于以下错误,检索CLSID为{00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:80080005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨 我正在我的本地机器上创建excel运行正常&它没有在远程服务器上运行。它在现有服务器上工作正常(10.254.544.88)。但是当我在新服务器上部署应用程序(10.254.544.125)时抛出错误。 我正在使用 - : Microsoft.Office.Interop.Excel 14.0 Asp.net 3.5框架 Window Sever 2008 IIS 7.5 Microsoft Office 2007安装在服务器上 错误 由于以下错误,检索CLSID为{00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:80080005 请帮助&什么是问题Hi I am creating excel running fine on my local machine & its not running on remote server. its works fine on existing server (10.254.544.88). but when i deploy application on new server (10.254.544.125) throw error.I am using -: Microsoft.Office.Interop.Excel 14.0 Asp.net 3.5 framework Window Sever 2008 IIS 7.5 Microsoft office 2007 Installed on serverError Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005Please help & What is issue推荐答案 总是使用COM将是一个问题(访问COM会因机器而异。我也遇到了同样的问题。所以我用OLEDB来创建excel。 我创建了一个模板文件(你要下载哪种格式) string strChgFileName =OUT+ System.DateTime.Now.ToString(yyyyMMddHHmmssfff)+。xls; string strWebServerSavePath = GetRefCodeValue(FileUpDownPath,1) +\\; string strTemplatePath = GetRefCodeValue(FileTemplatePath,1)+\\; File.Copy(strTemplatePath + Template.xls,strWebServerSavePath + strChgFileName); strWebServerSavePath + = strChgFileName; string strConString =Provider = Microsoft.Jet.OLEDB 。4.0; + 数据源=+ strWebServerSavePath +; + 扩展属性= \Excel 8.0; HDR = YES \; OleDbConnection con = new OleDbConnection(strConString); con.Open(); try { OleDbCommand cmd = new OleDbCommand(); cmd.Connection = con; int rowCount = 1; StringBuilder sbInserts; StringBuilder sbColValues; // CRAETE TABLE sbInserts = new StringBuilder(); for(int i = 1; i< = dtVIN.Columns.Count; i ++) { if(sbInserts.Length = = 0) { sbInserts.Append([+ dtVIN.Columns [i - 1] .ColumnName +]); } else { sbInserts.Append(,[+dtVIN.Columns [i - 1] .ColumnName +] ); } } foreach(dtVIN.Rows中的DataRow博士) { sbColValues = new StringBuilder(); rowCount + = 1; for(int i = 1;我< dtVIN.Columns.Count + 1; i ++) { if(sbColValues.Length == 0) sbColValues.Append('+ dr [i - 1] .ToString()+'); else sbColValues.Append(,'+ dr [i - 1] .ToString()+' ); } cmd.CommandText = String.Format(INSERT INTO [kn01u0Hi,Always using the COM will be an issue (The accessing of the COM will vary from one machine to another). I also faced the same issue. So I have used OLEDB to create the excel.I have created a template file (which format you want to download)string strChgFileName = "OUT" + System.DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".xls"; string strWebServerSavePath = GetRefCodeValue(FileUpDownPath, "1") + "\\"; string strTemplatePath = GetRefCodeValue(FileTemplatePath, "1") + "\\"; File.Copy(strTemplatePath + "Template.xls", strWebServerSavePath + strChgFileName); strWebServerSavePath += strChgFileName; string strConString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strWebServerSavePath + ";" + "Extended Properties=\"Excel 8.0;HDR=YES\""; OleDbConnection con = new OleDbConnection(strConString); con.Open(); try { OleDbCommand cmd = new OleDbCommand(); cmd.Connection = con; int rowCount = 1; StringBuilder sbInserts; StringBuilder sbColValues; //CRAETE TABLE sbInserts = new StringBuilder(); for (int i = 1; i <= dtVIN.Columns.Count; i++) { if (sbInserts.Length == 0) { sbInserts.Append("[" + dtVIN.Columns[i - 1].ColumnName + "]"); } else { sbInserts.Append(", [" + dtVIN.Columns[i - 1].ColumnName + "]"); } } foreach (DataRow dr in dtVIN.Rows) { sbColValues = new StringBuilder(); rowCount += 1; for (int i = 1; i < dtVIN.Columns.Count + 1; i++) { if (sbColValues.Length == 0) sbColValues.Append("'" + dr[i - 1].ToString() + "'"); else sbColValues.Append(", '" + dr[i - 1].ToString() + "'"); } cmd.CommandText = String.Format("INSERT INTO [kn01u0({0})VALUES({1}),sbInserts.ToString(),sbColValues.ToString()); cmd.ExecuteNonQuery(); } con.Close();({0}) VALUES({1})", sbInserts.ToString(), sbColValues.ToString()); cmd.ExecuteNonQuery(); } con.Close();检查CP中的这个链接,它谈论word文件,同样可能有助于excel同样。 检索具有CLSID {XXXX}的组件的COM类工厂因以下错误而失败:80040005 [ ^ ]Check this link in CP, it talks about word file, same might help for excel as well.Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040005[^] 这篇关于由于以下错误,检索CLSID为{00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:80080005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 05-31 19:48