Similar Threads:
1.error code 0x80040154 class not registered
We get this "Clip art cannot complete the operation"message and error code
0x80040154 class not registered and that is all we can get out of our Insert
Picture. Patiently we have tried EVERYTHING MS has to offer to NO avail!! Our
Office 2000 Pro worked flawlessly and we upgraded to this, YAK!!!
2.Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_
My current code ran in VS2003 on a XPpro machine. I transferred it to a Vista
machine and had to purchase VS2005 . I made the changes and the code ran. I
made additions over several weks and the code still ran . I did not run the
code a gain for about a month and then the code would not run on the Vista
machine so I installed VS2005 on an XPpro PC and the same then code compiiles
and runs fine.
Both PCs have Ofiice 2003 Pro on them and no other versions of Excel or
office.
It as if one of the MS regular Vista updates made a change causing the code
not to compile.
My code is in Visaul Basic
These are the first lines of the code
Imports System.IO
Imports System.IO.StreamReader
Imports System
Imports System.Threading
Imports System.text.regularexpressions
Imports System.Text
Imports System.Globalization
Imports System.Collections
Imports Microsoft.Office.interop.excel
Imports Excel = Microsoft.Office.Interop.Excel
Imports System.Reflection
Imports System.Runtime.InteropServices
The lines following this are Windows Form Designer Generated code (about
2000 of them ) Total program is about 9000 lines
Dim ExcelScheduler As New Excel.Application
Dim ExcelWB As Excel.Workbook =
ExcelScheduler.Workbooks.Open("C:\ExactaRecords\Scheduler.xls")
Dim ScheduleSheet1 As Excel.Worksheet = ExcelWB.Sheets(1)
Dim ScheduleSheet2 As Excel.Worksheet = ExcelWB.Sheets(2)
Dim ScheduleSheet3 As Excel.Worksheet = ExcelWB.Sheets(3)
ScheduleSheet1 = ExcelWB.Worksheets(1)
ScheduleSheet2 = ExcelWB.Worksheets(2)
ScheduleSheet3 = ExcelWB.Worksheets(3)
This is the error message:
System.InvalidCastException occurred
Message="Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed because
the QueryInterface call on the COM component for the interface with IID
'{000208D5-0000-0000-C000-000000000046}' failed due to the following error:
Library not registered. (Exception from HRESULT: 0x8002801D
(TYPE_E_LIBNOTREGISTERED))."
Source="Microsoft.Office.Interop.Excel"
StackTrace:
at Microsoft.Office.Interop.Excel.ApplicationClass.get_Workbooks()
at ShowTimeScheduler.ShowTimeDirector..ctor() in
C:\ShowTimeScheduler\Backup\ShowTimeDirector.vb:line 2222
Error occurs at the line :
Dim ExcelWB As Excel.Workbook =
ExcelScheduler.Workbooks.Open("C:\ExactaRecords\Scheduler.xls")
Does any one have any ideas how to fix this problem?
Thanks
3.Class not registered: 0x80040154
Hi everybody,
An OWC Spreadsheet is placed on a windows form in my C# project. This
application was written on a XP 32bit machine and is working smoothly
meanwhile. Thanks to a great support in this board!
Now I had the chance to install XP 64 on one of my machines and was
curious whether my app would work on that as well. After installing
the OWC from the MS Homepage, the build of the application went fine.
When I started it in the IDE it highlighted the line:
((System.ComponentModel.ISupportInitialize)
(this.axSpreadsheet1)).EndInit();
the message is.
Message="Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG))"
Source="System.Windows.Forms"
ErrorCode=-2147221164
StackTrace:
at
System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid,
Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
I browsed the internet without any luck. There was a little bit about
SQL Server, but that was about it. If you have any idea it would be
great if you can share it with me.
Cheers
Stocki
4.Interface not registered (Exception from HRESULT: 0x80040155)
I am working in MS Office Accounting Express 2007 and MS Office Word 2003 and
trying to either send a quote as an email or save as a Word document. This is
when I am getting this error.
Is there a compatability issue with the Accounting software and this version
of Word?
How can I get this fixed?
--
Eddi Rae
5.Exception from HRESULT: 0x800A03EC - COM Exception Unhandled
Hi,
I am working on exporting data from a dataset to excel. When I used save
file dialog to save the file in a desired path I came across this Error.
Please find below the code I have used
using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
namespace EXPORT_DATASET_EXCEL_II
{
static class ExportingCellByCellMethod
{
public static void ExportToExcel(DataSet dataSet, string outputPath)
// public static void ExportToExcel(DataSet dataSet)
{
// Create the Excel Application object
ApplicationClass excelApp = new ApplicationClass();
//excelApp.Interactive = false;
// Create a new Excel Workbook
Workbook excelWorkbook = excelApp.Workbooks.Add(Type.Missing);
int sheetIndex = 0;
// Copy each DataTable as a new Sheet
foreach (System.Data.DataTable dt in dataSet.Tables)
{
// Create a new Sheet
Worksheet excelSheet = (Worksheet)excelWorkbook.Sheets.Add(
excelWorkbook.Sheets.get_Item(++sheetIndex),
Type.Missing, 1, XlSheetType.xlWorksheet);
excelSheet.Name = dt.TableName;
// Copy the column names (cell-by-cell)
for (int col = 0; col < dt.Columns.Count; col++)
{
excelSheet.Cells[1, col + 1] = dt.Columns[col].ColumnName;
}
// Copy the values (cell-by-cell)
for (int col = 0; col < dt.Columns.Count; col++)
{
for (int row = 0; row < dt.Rows.Count; row++)
{
excelSheet.Cells[row + 2, col + 1] =
dt.Rows[row].ItemArray[col];
((Range)excelSheet.Rows[1,
Type.Missing]).AutoFit();
}
((Range)excelSheet.Columns[1,
Type.Missing]).AutoFit();
((Range)excelSheet.Columns[2,
Type.Missing]).AutoFit();
((Range)excelSheet.Columns[3,
Type.Missing]).AutoFit();
}
}
// Save and Close the Workbook
excelWorkbook.SaveAs(outputPath,
XlFileFormat.xlWorkbookNormal, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
XlSaveAsAccessMode.xlExclusive,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing);
excelWorkbook.Close(true, Type.Missing, Type.Missing);
excelWorkbook = null;
// Release the Application object
excelApp.Quit();
excelApp = null;
// Collect the unreferenced objects
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Configuration;
namespace EXPORT_DATASET_EXCEL_II
{
public partial class Form1 : Form
{
System.Data.OleDb.OleDbConnection conn;
OleDbDataAdapter DA;
string S;
DataSet source;
public Form1()
{
InitializeComponent();
conn = new System.Data.OleDb.OleDbConnection();
conn.ConnectionString =
ConfigurationManager.ConnectionStrings["MSAccess"].ToString();
}
private DataSet getDemoDataSet()
{
S = "Select Emp_ID as [ID], Emp_Name as NAME,Reason as REASON,
Submitted_Date as [SUBMITTED DATE] from LEAVEMASTER_TABLE";
source = new DataSet();
DA = new OleDbDataAdapter(S, conn);
DA.Fill(source);
source.Tables[0].TableName = "sample";
return source;
}
private void button2_Click(object sender, EventArgs e)
{
DataSet demoDataSet = this.getDemoDataSet();
string savepath;
saveFileDialog1 = new SaveFileDialog();
savepath = saveFileDialog1.FileName + ".xls";
saveFileDialog1.Filter = "xls files (*.xls)|*.xls";
if (saveFileDialog1.ShowDialog() ==
System.Windows.Forms.DialogResult.OK
&& saveFileDialog1.FileName.Length > 0)
{
ExportingCellByCellMethod.ExportToExcel(demoDataSet,
savepath);
}
MessageBox.Show("Data Exported successfully");
}
}
}
Can anyone help me out in solving this? Replies are highly appreciated. TIA.
--
Regards,
Karthik
6. Class Not Registered Error In Vis Studio IDE
7. class not registered
8. Class Not Registered Error