Windows error 0x80028018, -2147319784

Detailed Error Information

TYPE_E_INVDATAREAD[1]

MessageOld format or invalid type library.
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode2 (0x002)
NameFACILITY_DISPATCH[2][1]
DescriptionThe source of the error code is a COM Dispatch.[2][1]
Error Code32792 (0x8018)

Questions

14votes
5answers

Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))

The error appeared when exporting data in a datagrid view to an Excel sheet: > error (Old format or invalid type library. (Exception from HRESULT: 0x80028018 > (TYPE_E_INVDATAREAD))) on this line: Microsoft.Office.Interop.Excel._Workbook workbook = app.Workbooks.Add(Type.Missing); How do I fix this problem? My full code: private void button1_Click(object sender, EventArgs e) [...] read more
c#
winforms
excel
datagridview
8votes
1answer

Microsoft.Office.Interop.Excel doesn't work on 64 bit

I've encountered a problem when developing on MS Visual Web Developer 2008 Express Ed. Developing ASP.NET C# on Windows7 64 bit OS. I'm trying to open an Excel document, but it gives me Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)) I did configured the build to [...] read more
asp.net
interop
hresult
comobject
4votes
1answer

Open and read Excel file with C++/CLI

I am trying to create a program with C++/CLI that reads some data from Excel workbooks using Visual Studio. I have added Microsoft.Office.Interop.Excel (v12) to the references in the project properties. My basic goal would be only to get a cell's value as a string (the workbook contains only text [...] read more
c++
.net
excel
command-line-interface
2votes
1answer

Excel/VSTO: error 0x80028018 only when binding directly to interop.-provided property

When I try to set Worksheet's Name property using this test application, it doesn't work due to an 0x80028018 error. Test form [https://i.stack.imgur.com/OLorh.png] When I change the value in the first text box, and I click the tab button, nothing happens, while I expect the Sheet1 to be renamed. In [...] read more
c#
excel
wpf
vsto
2votes
1answer

How to read Excel files in powershell?

I would like to parse the following Excel file which perfectly open in the application. I browsed the Internet and lots of guys said that those two command lines do open Excel files (example Read Excel sheet in Powershell). $excel = New-Object -com excel.application $wb = $excel.workbooks.open("c:\users\administrator\my_test.xls") But I have [...] read more
excel
powershell
2votes
1answer

Excel API Error

I am using a standardized tool to access the Excel API (software robot). However since upgrading to Office 2013, I am getting an error when I try to open a workbook. The error is this: > Internal : Could not execute code stage because exception thrown by code > stage: [...] read more
vb.net
excel
ms-office
2votes
2answers

Office 2013 c# add-in - Null workbook object HRESULT: 0x800A03EC error

Using Visual Studio Enterprise 2015 and office 2013 pro, I have created an Excel 2013 addin and when I debug it, I am unable to reference the Application.Workbook object! Here is a minimal example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using Excel = Microsoft.Office.Interop.Excel; using Office [...] read more
c#
.net
excel
ms-office
office-interop
2votes
2answers

export data in datagridview to excel sheet windows form

I have DataGridView and when I display export to excel sheet button following error appeared: (Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))) here ( xlWorkBook = xlApp.Workbooks.Add(misValue); ) and this reference which I used (Microsoft excel 12.0) private void button1_Click(object sender, EventArgs e) { Microsoft.Office.Interop.Excel.Application xlApp [...] read more
c#
winforms
datagridview
export-to-excel
2votes
1answer

Open excel file from Sharepoint 2007 Document Library with C#

I'm trying to open an excel file from a Sharepoint Document Library. My application searches for the specific file, gets its link and uses it to download and further opening. My app works on my machine and on test server, but when i send it to quality assurance servers, problems [...] read more
c#
excel
sharepoint-2007
excel-interop
2votes
2answers

Reading text format from Excel using Microsoft.Office.Interop.Excel

I am trying to read text format e.g. the Strikethough property via myworksheet.Cells[row, col].DisplayFormat.Style.Font.Strikethrough; However, the result is always false, not matter what the actual formatting is. Right before that, I read the value of the same cell using: myworksheet.Cells[row, col].Value; And get the correct value. When I try using [...] read more
.net
excel
office-interop
1vote
1answer

I keep getting System.Runtime.InteropServices.COMException (0x80028018): Old format or invalid type library. error

I try to update the excel sheet rows with their corresponding row colors from the ListView - objLv objLv = ListView I added a Reference to System.Drawing.dll - Runtime Version v2.0.50727 - Version 2.0.0.0 The error occurs at 'workbook.Styles.Item(i).Interior.Color... So it's the 6th line of the code below. I applied [...] read more
vb.net
excel
listview
1vote
1answer

C#: Open Excel (.XLSX) WorkBook => COMException

I try to open a .XLSX file from VS2010 .NET 3.5 on a 64bit Windows 7. Thats the code: string fileName = string.Format("{0}\\test.xlsx", Directory.GetCurrentDirectory()); Application _excelApp = new ApplicationClass(); Workbook workBook = _excelApp.Workbooks.Open(fileName); thats the error I get: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)) What [...] read more
c#
excel
interop
1vote
1answer

Open Excel file .NET Framework 3.5

I wrote a VB .NET program that opens an Excel Workbook to put some values. Here is the code that open the file: OpenFileDialog1.FileName = "" OpenFileDialog1.Filter = "Excel files (*.xls)|*.xls" OpenFileDialog1.ShowDialog() filePath = OpenFileDialog1.FileName If System.IO.File.Exists(filePath) Then oExcel = CreateObject("Excel.Application") oExcel.Visible = True oBook = oExcel.Workbooks.Open(filePath) End If This [...] read more
.net
vb.net
excel
0votes
0answers

Error when read excel from Microsoft.Office.Interrop.Excel

i use Microsoft.Office.Interop.Excel to read Excel Here is my code: System.Globalization.CultureInfo oldCI = System.Threading.Thread.CurrentThread.CurrentCulture; System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ko-KR"); Excel.Application eApp = new Excel.Application() Excel.WorkBook oBooks = eApp.Workbooks.Open(fileName) When it run to Open file Name it show error Old format or invalid type library. > (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)).How I [...] read more
c#
excel
excel-interop
0votes
1answer

error BC30560: 'XlDirection' is ambiguous in the namespace 'Microsoft.Office.Interop.Excel

I have a strange problem with Excel automation in VSTO. The below code works well with English but not with German language. The error is coming from first line of the code below. I get the following error when I watch the execution. Can someone tell me what's going wrong [...] read more
vba
excel
vsto
0votes
1answer

Runtime error -2147319784 (0x80028018) with Excel 2013 on Windows 8

I have an Excel application, with lots of macros in it. The macros in the workbook are signed. Some of the macros call Windows API functions and they have been ported to support 32-bit and 64-bit versions of Excel properly. The application works fine on different configurations (Windows XP, Windows [...] read more
excel
vba
runtime-error
0votes
1answer

Format too old or invalid type library in Chinese Excel 2010

Error came at Startup of Excel 2010 in Chinese MS Office . > Error is as followS 格式太旧或类型程序库无效 . (Exception from HRESULT: 0x80028018 > (TYPE_E_INVDATAREAD) ) Please Assist ? read more
c#
ms-office
vsto
0votes
1answer

Why can't Visual Basic convert my datatable into an excel datatable?

I'm trying to make a program with a local database where I can have an overview for our company savings. Nothing really special. Anyway, I want to export the dataset to an excel file when I click on the export button. This is my code Dim dt As DataTable Dim [...] read more
vb.net
excel
datatable
interop
export
0votes
1answer

Excel Add-In not working in French Excel

I have developed an Add-in for excel using VB .NET and ExcelDNA. The Add-In works on my computer and all computers which has an english version of excel. However, it does not work on my clients computer(is in English) which has a French version of Excel. I get the following [...] read more
.net
vb.net
excel
0votes
0answers

Powershell, excel 2003 and 'type library' exception

I have written some simple powershell script: $excel = New-Object -com Excel.Application $excel.Workbooks.Open("C:\temp\mybook.xls") It runs OK in on PC. However, when my colleague runs it, he gets this exception Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)) What does this error message mean? read more
excel
powershell
excel-2003
0votes
1answer

Exporting dataset to xlsx with Microsoft.Office.Interop.Excel

I was using the following Code in order to export a dataset to xlsx. Everything works fine when i am on .net 4.0 but there is a server that requires the framework to be in 3.5 unfortunately and i can't do anything about it. So i changed the framework from [...] read more
c#
.net
0votes
1answer

error when export datagrid view to excel sheet

I Had data gridview in widows application and I added button to export data to excel sheet but these appeared Cannot implicitly convert type 'object' to 'Microsoft.Office.Interop.Excel._Worksheet'. An explicit conversion exists (are you missing a cast?) here ( worksheet = workbook.Sheets["Sheet1"];) and this error apeared (No overload for method 'SaveAs' [...] read more
c#
excel
datagridview

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0