View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
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