Solved

Exporting VB.NET datagrid to an excel sheet

Posted on 2002-03-14
5
444 Views
Last Modified: 2010-05-02
Hi,

anyone got any code so that I can export a VB.NET datagrid dataset to an excel sheet?

Thanks,

Del.
0
Comment
Question by:deljones
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 17

Expert Comment

by:inthedark
ID: 6864138
Simple was is to place the grid onto the clipboard, then is can be pasted anywhere:

The clipboard format required by excel is like:


Field1 TAB Field2 TAB Field3 TAB Field4 vbCrLf

Where tab is CHR(9)

Each row looks the same.
0
 

Author Comment

by:deljones
ID: 6864157
Thanks,

but I really need to do it in code.  I want my users to be able to export at will to an excel sheet.
0
 
LVL 44

Accepted Solution

by:
bruintje earned 300 total points
ID: 6865660
Hi deljones, don't know if there are any sample exactly like your question but i guess with these samples you can get to it

Microsoft Knowledge Base articles can be found at:
http://search.support.microsoft.com/kb/c.asp
Choose to search by "specific article ID number"
Enter the article number including the "Q"

dotNet
------
Q306022 HOW TO: Transfer Data to an Excel Workbook Using Visual Basic .NET
(pending)
Q306572 HOW TO: Query and Display Excel Data Using ASP.NET, ADO.NET
Q311731 HOW TO: Query and Display Excel Data Using ADO.NET, VB .NET

General
-------
Q257819 HOWTO: Use ADO with Excel Data from Visual Basic or VBA
Q303814 HOWTO: Use ADOX with Excel Data from Visual Basic or VBA

Transferring Data into Excel
----------------------------
Q247412 INFO: Methods for Transferring Data to Excel from Visual Basic
Q295646 HOWTO: Transfer Data from ADO Data Source to Excel with ADO

HTH:O)Bruintje
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7618284
Hi deljones,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept bruintje's comment(s) as an answer.

deljones, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7665726
Moving to the paq

kb
Experts Exchange Moderator
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question