Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Exporting VB.NET datagrid to an excel sheet

Posted on 2002-03-14
5
Medium Priority
?
457 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
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 1200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

963 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