473,809 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I output a recordset to Excel in VB.Net?

I am trying to output a recordset that I have to Excel XP?

I don't know how to do it. I have the Office 10 COM
Object library reference, and I just need to know how to
take my recordset, locate the excel file, and move the
contents of the recordset to a worksheet.

Any help would be greatly appreciated.
Jul 19 '05 #1
1 4861
SR
Hi mike

I had written sometime back a VB.Net function which takes
a dataset as a parameter and then exports all the tables
to a Excel File in separate sheets. Quite a generic
function. Loops thru the tables, then the records and
then ports the data to excel using automation

Later i moved over to a SQL Server DTS approach to improve
performance, where i create a DTS package to do the same
and from my VB.Net function just execute the DTS package

The code for these are lengthy and if i post it here it
gets wrapped(or should i say warped !!! :) ). If u need
the code for the same do mail me at rs*****@hotmail .com

regards,

sr
-----Original Message-----
I am trying to output a recordset that I have to Excel XP?

I don't know how to do it. I have the Office 10 COM
Object library reference, and I just need to know how to
take my recordset, locate the excel file, and move the
contents of the recordset to a worksheet.

Any help would be greatly appreciated.
.

Jul 19 '05 #2

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

Similar topics

7
8510
by: Jean | last post by:
Hello, I have a form that performs a search, according to criteria that a user enters into the text boxes. When the user clicks on „Search", a SQL string (say strSQL) is built up with the criteria. Then a list box RowSource property is set to this strSQL, to display the results of the search. StrSQL is a global variable within this Form's code module, i.e. in the class module.
2
2478
by: Galina | last post by:
Hello All of a sudden I started getting error 13, type mismatch in a command, which was running happily for years. Here is a code: Option Compare Database Option Explicit Dim CmdClose1_Clicked As Boolean, CmdClose_Clicked As Boolean Private Sub CmdClose_Click() On Error GoTo Err_CmdClose_Click 'Check, if there are any messages marked to delete
6
6559
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query works fine, but passing the resulting recordset back to the sub's caller is not working out.
4
2005
by: Banu_tr | last post by:
Hello, In my windows app. I send the result of sp to excel sheet. It has siz column. My problem is, I want to make the text in a column to hyperlink. How ca nI do this when I am sending the info to excel. thanks,
1
275
by: mike newman | last post by:
I am trying to output a recordset that I have to Excel XP? I don't know how to do it. I have the Office 10 COM Object library reference, and I just need to know how to take my recordset, locate the excel file, and move the contents of the recordset to a worksheet. Any help would be greatly appreciated.
2
1204
by: Thanks | last post by:
I am using asp.net(2003). I would like to output the data from the result of storeprocedure (sql 2000 server) into excel format. (office 2003) Can I do that? Please show me the coding if it can.
1
6507
by: Jaime Leivers | last post by:
Here's a median function in access that you can call in any query. You could change this to any excel function you wanted. Most people can find the windows help file that says how to call an excel function but don't know how to pass an array of the recordset they made into that function. This uses GetRows that nicely creates an array that can be passed into excel. I have this data table for testing. The table name is TestData ...
0
1208
by: Sonnich | last post by:
Hi all! I haven't being doing that much in ASP, but I have to create this: It has to read out data from some DB to excel. The following (corrected) code works if just it outputs as html, once the Response.ContentType is excel. then it offers to open/save the file, and stops - file not found - what do I do wrong? BR
2
3357
by: Mike | last post by:
Hi everyone, I found the Access reports too limited to do what i wanted so i created a module to export a crosstab query to an excel file, and then i modify it as i want. My problem is that i created a unique query for every "sector", saved them, and select the right one according to the user's choice. What i'd like to do is to create the crosstab query directly in VBA, change the WHERE part for the sector i want to show and output it...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7662
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
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 we have to send another system

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.