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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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