Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cannot Get Instance of Com component Microsoft.Office.Interop.Excel.Worksheetwith Excel Interface Error.

There is one UI instance of Excel 2007 up with an error message and
when I try to instantiate the worksheet component through VB.Net I get
this error: It seems that the UI instance is blocking access to the
worksheet component.

VB.Net Error:
"Creating an instance of the COM component with CLSID
{00020820-0000-0000-C000-000000000046} from the IClassFactory failed
due to the following error: 80010001."


Excel UI Error:
The file you are trying to open test.xls is in a different format than
specified by the file extension.

VB.Net Code:
Dim MainWorkSheet As New Microsoft.Office.Interop.Excel.Worksheet



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Cannot Get Instance of Com component Microsoft.Office.Interop.Excel.Worksheetwith Excel Interface Error.

On Aug 28, 11:19*pm, "Michael G." wrote:
There is one UI instance of Excel 2007 up with an error message and
when I try to instantiate the worksheet component through VB.Net I get
this error: *It seems that the UI instance is blocking access to the
worksheet component.

VB.Net Error:
"Creating an instance of the COM component with CLSID
{00020820-0000-0000-C000-000000000046} from the IClassFactory failed
due to the following error: 80010001."

Excel UI Error:
The file you are trying to open test.xls is in a different format than
specified by the file extension.

VB.Net Code:
*Dim MainWorkSheet As New Microsoft.Office.Interop.Excel.Worksheet


What library did you referance? Excel 11.0 or 12.0? If you have Excel
2007 then you have 12.0 library which can't read xls files, just xlsx
files. 11.0 reads xls files. So if you want to read that file get
yourself Excel 2003.
Other way to solve this is to use GemBox.Spreadsheet component. It is
not dependable on any Excel version so you won't have problems like
this. Take a look: http://www.gemboxsoftware.com/GBSpreadsheet.htm
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Cannot Get Instance of Com component Microsoft.Office.Interop.Excel.Worksheet with Excel Interface Error.


then you have 12.0 library which can't read xls files, just xlsx files.


What? 12 can read any Excel format going back to at least 4 if not
earlier.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sat, 29 Aug 2009 08:30:04 -0700 (PDT), filip
wrote:

On Aug 28, 11:19*pm, "Michael G." wrote:
There is one UI instance of Excel 2007 up with an error message and
when I try to instantiate the worksheet component through VB.Net I get
this error: *It seems that the UI instance is blocking access to the
worksheet component.

VB.Net Error:
"Creating an instance of the COM component with CLSID
{00020820-0000-0000-C000-000000000046} from the IClassFactory failed
due to the following error: 80010001."

Excel UI Error:
The file you are trying to open test.xls is in a different format than
specified by the file extension.

VB.Net Code:
*Dim MainWorkSheet As New Microsoft.Office.Interop.Excel.Worksheet


What library did you referance? Excel 11.0 or 12.0? If you have Excel
2007 then you have 12.0 library which can't read xls files, just xlsx
files. 11.0 reads xls files. So if you want to read that file get
yourself Excel 2003.
Other way to solve this is to use GemBox.Spreadsheet component. It is
not dependable on any Excel version so you won't have problems like
this. Take a look: http://www.gemboxsoftware.com/GBSpreadsheet.htm

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Cannot Get Instance of Com component Microsoft.Office.Interop.Excel.Worksheet with Excel Interface Error.

As Chip has pointed out this is not an Excel version/library issue. This
error message will show even if manually user attempts to open (say) an xlsx
that has been renamed xls.

Very often in the last few weeks I've noticed Gembox being promoted as the
solution to some problem even though it has nothing to do with the actual
issue of the thread, yet alone a solution.

I'm sure you mentioned the library reference in good faith, but can I ask if
you are in some way connected with Gembox.

Regards,
Peter T



"filip" wrote in message news:97f08ab0-0876-48b3-8fa4-

Excel UI Error:
The file you are trying to open test.xls is in a different format
than specified by the file extension.


What library did you referance? Excel 11.0 or 12.0? If you have Excel
2007 then you have 12.0 library which can't read xls files, just xlsx
files. 11.0 reads xls files. So if you want to read that file get
yourself Excel 2003.
Other way to solve this is to use GemBox.Spreadsheet component.
It is not dependable on any Excel version so you won't have problems
like this.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Cannot Get Instance of Com component Microsoft.Office.Interop.Excel.Worksheet with Excel Interface Error.

While an Excel dialog is displayed normally you cannot automate Excel. This
can pose a dilemma if you are not sure what the dialog is, why it is
displaying and is it waiting for the user to handle (whilst gone for a
coffee) or triggered due to some action of your own code.

Assuming at least you have an object reference to the application you can
try something like this (either in advance or after catching the error)

If xlApp.Ready = False then
some dialog showing or user in edit mode
loop with a timer until .Ready = true or abort
or perhaps even SendKeys (or API equivalent) an Esc to dismiss the known
dialog


Regards,
Peter T


"Michael G." wrote in message
...
There is one UI instance of Excel 2007 up with an error message and
when I try to instantiate the worksheet component through VB.Net I get
this error: It seems that the UI instance is blocking access to the
worksheet component.

VB.Net Error:
"Creating an instance of the COM component with CLSID
{00020820-0000-0000-C000-000000000046} from the IClassFactory failed
due to the following error: 80010001."


Excel UI Error:
The file you are trying to open test.xls is in a different format than
specified by the file extension.

VB.Net Code:
Dim MainWorkSheet As New Microsoft.Office.Interop.Excel.Worksheet







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Cannot Get Instance of Com component Microsoft.Office.Interop.Excel.Worksheet with Excel Interface Error.

PS
I should have clarified it's not possible to check the .Ready state with all
dialogs and situations, though in a quick check it should work with your
particular error message.

Peter T

"Peter T" <peter_t@discussions wrote in message
...
While an Excel dialog is displayed normally you cannot automate Excel.
This can pose a dilemma if you are not sure what the dialog is, why it is
displaying and is it waiting for the user to handle (whilst gone for a
coffee) or triggered due to some action of your own code.

Assuming at least you have an object reference to the application you can
try something like this (either in advance or after catching the error)

If xlApp.Ready = False then
some dialog showing or user in edit mode
loop with a timer until .Ready = true or abort
or perhaps even SendKeys (or API equivalent) an Esc to dismiss the known
dialog


Regards,
Peter T


"Michael G." wrote in message
...
There is one UI instance of Excel 2007 up with an error message and
when I try to instantiate the worksheet component through VB.Net I get
this error: It seems that the UI instance is blocking access to the
worksheet component.

VB.Net Error:
"Creating an instance of the COM component with CLSID
{00020820-0000-0000-C000-000000000046} from the IClassFactory failed
due to the following error: 80010001."


Excel UI Error:
The file you are trying to open test.xls is in a different format than
specified by the file extension.

VB.Net Code:
Dim MainWorkSheet As New Microsoft.Office.Interop.Excel.Worksheet







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in excel com: Microsoft.Office.Interop.Excel Exception from HRESULT: 0x800A03EC srinivas[_3_] Excel Programming 3 May 29th 09 02:13 PM
Microsoft.Office.Interop.Excel.Application Andie Excel Programming 1 May 22nd 09 04:27 AM
Microsoft.Office.Interop.Excel Texttocolumns C# Cheryl[_5_] Excel Programming 1 April 6th 07 08:40 PM
Where can I find Microsoft.Office.Interop.Excel.dll? Fred Abrahamian Excel Programming 1 December 17th 06 10:52 PM
Microsoft.Office.Interop.Excel SaveAs error when clicking no or ca NeedsExcelAssistance Excel Programming 0 July 14th 06 02:50 PM


All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"