473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Writing Excel (binary) XLS from datagridview

I've found several examples of exporting to Excel (XML) from a DataGridView.
I need to export to an actual binary XLS file from a DataGridView. I've
found what I think are a couple of examples but I end up getting
ComExceptions when using the examples.
I've got Microsoft Excel 11.0 Object Library included as a Reference in my
solution.

Does anyone know of a good example of exporting from a DataGridView to an
Excel binary XLS file?
Or, is there any easy way to convert the Excel XML to Excel XLS (binary)?

Thanks...
Jun 27 '08 #1
2 3329
Have you made sure to download the primary interop assemblies (PIAs) for
Office? I believe 11.0 is for Office 2003, here's the link to download it:

http://www.microsoft.com/downloads/d...displaylang=en

Knowing what exception you're getting would also help us to help you.

"Randy" <te**@temp.comwrote in message
news:OY*************@TK2MSFTNGP02.phx.gbl...
I've found several examples of exporting to Excel (XML) from a
DataGridView. I need to export to an actual binary XLS file from a
DataGridView. I've found what I think are a couple of examples but I end
up getting ComExceptions when using the examples.
I've got Microsoft Excel 11.0 Object Library included as a Reference in my
solution.

Does anyone know of a good example of exporting from a DataGridView to an
Excel binary XLS file?
Or, is there any easy way to convert the Excel XML to Excel XLS (binary)?

Thanks...
Jun 27 '08 #2
Hi,

I think i have the right ting for you. It is much better to use some
third party .NET component than Excel Automation (http://
http://www.gemboxsoftware.com/GBSpre...htm#Automation) and i recommend
you to use GemBox.Spreadsheet (http://www.gemboxsoftware.com/
GBSpreadsheet.htm). If you don't want to pay for component, you can
try GemBox.Spreadsheet free that you can use even in your commercial
applications. Free version comes with 150 rows limit.

Mario
GemBox Software
--
GemBox.Spreadsheet for .NET - Easily read and write Excel (XLS, XLSX
or CSV)
or export to HTML files from your .NET apps. See
http://www.gemboxsoftware.com/GBSpreadsheet.htm
--

On May 16, 5:55 pm, "Randy" <t...@temp.comwrote:
I've found several examples of exporting toExcel(XML) from a DataGridView.
I need to export to an actual binaryXLSfile from a DataGridView. I've
found what I think are a couple of examples but I end up getting
ComExceptions when using the examples.
I've got MicrosoftExcel11.0 Object Library included as a Reference in my
solution.

Does anyone know of a good example of exporting from a DataGridView to anExcelbinaryXLSfile?
Or, is there any easy way to convert theExcelXML toExcelXLS(binary)?

Thanks...
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jon Brookins | last post by:
I'm reposting this question as the other post seems to have been sucked into the net black hole. I'll keep this short. I am trying to read and edit an Excel workbook in its native BIFF format. ...
0
by: artteam | last post by:
Hi All, I try to export the table in DataGridView control on my form to MS excel with the following code. private void fnExtractToExcel() { ...
2
by: artteam | last post by:
Hi All, I try to export the table in DataGridView control on my form to MS excel with the following code. private void fnExtractToExcel() { Microsoft.Office.Interop.Excel.ApplicationClass...
5
by: Mike Wilson | last post by:
Hello all, I'd like to export a DataGridView to Excel. I am using .NET 2.0 and VB.NET. But I don't know if the user has Excel on their machines, so can't use COM Excel object. Any ideas...
1
by: pompair | last post by:
Hi, I've been implementing a program that populates winforms DataGridView from an excel sheet (.xlsx-file). The app works ok. Now I'm refactoring it and I've got a feeling that databinding...
0
by: nudrat | last post by:
Hi All, I have an excel sheet. I am able to read each cell values of excel sheet. Now i have a datagridview control. so how do i populate these cell values into datagridview control without using...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
20
by: Marin Brkic | last post by:
Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.