473,472 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

datagrid to excel

RTT
hey,

i made a windows form where i created a datagrid with a datatable as it's
datasource. now i want to supplie a save button to my users so the datagrid
can be exported to excel. how can i do this?

thxs
Nov 21 '05 #1
3 1881
Hi,

http://support.microsoft.com/kb/319180/EN-US/

http://support.microsoft.com/default...b;en-us;306022

Ken
-------------------
"RTT" <RT*@pandora.be> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
hey,

i made a windows form where i created a datagrid with a datatable as it's
datasource. now i want to supplie a save button to my users so the datagrid
can be exported to excel. how can i do this?

thxs

Nov 21 '05 #2
RTT
I'm using windows 2000 with excel 2000 SP3, i import the microsoft office
9.0 object library. But when i use your code i receive the error
"System.Runtime.InteropServices.COMException (0x80028018): Old format or
invalid type library." at those line like:
oExcelWorkbooks.Add()
i try almost everything i found at
http://support.microsoft.com/kb/319180/EN-US/

http://support.microsoft.com/default...b;en-us;306022

seems like they al use 10.0 object library, but i only have the 9. isn't
theire any simple solution to import my datatable or may datagrid to excel?
i think i try almost everything. :s

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uS**************@TK2MSFTNGP14.phx.gbl...
Hi,

http://support.microsoft.com/kb/319180/EN-US/

http://support.microsoft.com/default...b;en-us;306022

Ken
-------------------
"RTT" <RT*@pandora.be> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
hey,

i made a windows form where i created a datagrid with a datatable as it's
datasource. now i want to supplie a save button to my users so the datagrid can be exported to excel. how can i do this?

thxs

Nov 21 '05 #3
RTT
found solution to my problem:
http://msdn.microsoft.com/library/de..._VSTMultCR.asp
"RTT" <RT*@pandora.be> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I'm using windows 2000 with excel 2000 SP3, i import the microsoft office
9.0 object library. But when i use your code i receive the error
"System.Runtime.InteropServices.COMException (0x80028018): Old format or
invalid type library." at those line like:
oExcelWorkbooks.Add()
i try almost everything i found at
http://support.microsoft.com/kb/319180/EN-US/

http://support.microsoft.com/default...b;en-us;306022

seems like they al use 10.0 object library, but i only have the 9. isn't
theire any simple solution to import my datatable or may datagrid to excel? i think i try almost everything. :s

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uS**************@TK2MSFTNGP14.phx.gbl...
Hi,

http://support.microsoft.com/kb/319180/EN-US/

http://support.microsoft.com/default...b;en-us;306022

Ken
-------------------
"RTT" <RT*@pandora.be> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
hey,

i made a windows form where i created a datagrid with a datatable as it's datasource. now i want to supplie a save button to my users so the

datagrid
can be exported to excel. how can i do this?

thxs


Nov 21 '05 #4

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

Similar topics

1
by: Ugo | last post by:
Hi, I am having a problem exporting a Datagrid to excel in asp.net. For some reason I am getting a blank excel page. I set up in IIS the Mime for ..xls. My code is below any help would be...
3
by: Syd | last post by:
Hi all, Is there a way to get data from a datagrid and send to an excel table?And if it is possible how can arranged the excel table... Thanks
2
by: Steve Chatham | last post by:
I use the following code: Private Sub RbtnExport_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbtnExport.SelectedIndexChanged Dim sFile As String =...
1
by: Ed Chiu | last post by:
Hi, I copied the following codes from Internet to export datagrid to Excel, it works with datagrid not supporting sorting or paging. Response.ContentType = "application/vnd.ms-excel"...
2
by: TM | last post by:
I have an Excel sheet where I setup my needed formatting, page settings, ect, and would like to take my data from a datagrid and paste it into the excel file and print the excel file. Any idea...
5
by: Dave | last post by:
In a VB.NET application, I have a datagrid that I export to an Excel spreadsheet like this: ' Set the content type to Excel Response.ContentType = "application/vnd.ms-excel" Dim tw As New...
1
by: steve | last post by:
Hi, I have generated a datagrid with the following columns: | Date-Time | Station ID | Parameter1 | .... | Parameter 2| I would like to: Create an Excel file and preferably give the user...
4
by: Frank | last post by:
Hello All, I ham using VS.NET 2003. Have followed instructions from http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several other articles to no avail. I am pulling my hair...
0
by: letsgetsilly | last post by:
I am populating a datagrid and outputting it to excel. Everything worked well last night, but today excel only displays the content in font color white, which is impossible to see. The data is all...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.