473,756 Members | 9,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting to Excel

Hi All,
In Access97 I have a table that's greater than 65k records and I'm
looking for a VBA way to export the records to Excel.

Anyone have vba code to export from access to excel and have the code
use multiple excel tabs within a workbook????

Anyone have vba code that would create a temp table write 65,000
records to it, export those to excel, clean the temp table, append the
next 65,000 records, export it to excel with a different name, clear
the temp table, etc............ til it gets all the records from the
source table exported ???

thanks
bobh.

Mar 20 '06 #1
21 6241
PCD
Bob,

Start by looking at the Transferspreads heet method in the Help file.
DoCmd.TransferS preadsheet..... ... can be used to export data from Access to
Excel.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdata sheet.com

"bobh" <vu******@isp.c om> wrote in message
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .
Hi All,
In Access97 I have a table that's greater than 65k records and I'm
looking for a VBA way to export the records to Excel.

Anyone have vba code to export from access to excel and have the code
use multiple excel tabs within a workbook????

Anyone have vba code that would create a temp table write 65,000
records to it, export those to excel, clean the temp table, append the
next 65,000 records, export it to excel with a different name, clear
the temp table, etc............ til it gets all the records from the
source table exported ???

thanks
bobh.

Mar 20 '06 #2
PCD wrote:
Bob,

Start by looking at the Transferspreads heet method in the Help file.
DoCmd.TransferS preadsheet..... ... can be used to export data from Access to
Excel.


Steve, just a suggestion here - Why don't you occasionally try reading
the OP before posting your advertising.

--
To the original poster:

It is commonly accepted that these newsgroups are for free
exchange of information. Please be aware that PC Datasheet
is a notorious job hunter. If you are considering doing
business with him then I suggest that you take a look at
the link below first.

http://home.tiscali.nl/arracom/whoissteve.html

Randy Harris
Mar 20 '06 #3
bobh wrote:
Hi All,
In Access97 I have a table that's greater than 65k records and I'm
looking for a VBA way to export the records to Excel.

Anyone have vba code to export from access to excel and have the code
use multiple excel tabs within a workbook????

Anyone have vba code that would create a temp table write 65,000
records to it, export those to excel, clean the temp table, append the
next 65,000 records, export it to excel with a different name, clear
the temp table, etc............ til it gets all the records from the
source table exported ???

thanks
bobh.


Bob, I think you've really got two seperate issues here. Perhaps the
easier of the two is to send the data to multiple sheets in Excel. I
can supply some sample code to do that. I think, however, you first
need to figure out how to the break up the data into "chunks". You
could use the GetRows method to grab the first, say 50K rows, but I'm
not entirely sure how you would then get the next sets. The only
"obvious" method that occurs to me, would be to set up a giant recordset
and go through all of the records incrementally in a "brute force"
approach. I suspect that someone else will have a much more elegant
solution.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Mar 20 '06 #4
PCD
Just a suggestion here -------

STOP making yourself look like an obsessed A#$&@# in front of all the
newsgroup readers!!!!

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdata sheet.com

"Please Stop Advertising" <pl****@no.spam > wrote in message
news:Jr******** ********@newssv r27.news.prodig y.net...
PCD wrote:
Bob,

Start by looking at the Transferspreads heet method in the Help file.
DoCmd.TransferS preadsheet..... ... can be used to export data from Access
to Excel.


Steve, just a suggestion here - Why don't you occasionally try reading
the OP before posting your advertising.

--
To the original poster:

It is commonly accepted that these newsgroups are for free
exchange of information. Please be aware that PC Datasheet
is a notorious job hunter. If you are considering doing
business with him then I suggest that you take a look at
the link below first.

http://home.tiscali.nl/arracom/whoissteve.html

Randy Harris

Mar 20 '06 #5

"PCD" <no***@email.co m> schreef in bericht news:KX******** ***********@new sread1.news.atl .earthlink.net. ..
Just a suggestion here -------

STOP making yourself look like an obsessed A#$&@# in front of all the
newsgroup readers!!!!


Feeling lost and alone Steve??
Changed your nickname here again? ==>> Won't help that much....

We don't like you in this newsgroup. In fact *nobody* likes your behaviour here.
So why don't you just get lost (I mean STOP) with your advertising/jobhunting?

Arno R

Mar 21 '06 #6
"PCD" <no***@email.co m> wrote in
news:KX******** ***********@new sread1.news.atl .earthlink.net:
Just a suggestion here -------

STOP making yourself look like an obsessed A#$&@# in front of
all the newsgroup readers!!!!


Well Steve,YOU made an A$$ of yourself by firing off another of
your incorrect replies, because the original poster was quite clear
in that he eexceeded the 64Ki record limit that your solution
suffers.

As long as you persist in posting erroneous answers that show your
incompetence above your advertising which violates newsgroup rules,
you are gonna get deservedly spanked.
--
Bob Quintal

PA is y I've altered my email address.
Mar 21 '06 #7
"bobh" <vu******@isp.c om> wrote in
news:11******** **************@ t31g2000cwb.goo glegroups.com:
Hi All,
In Access97 I have a table that's greater than 65k records and
I'm looking for a VBA way to export the records to Excel.

Anyone have vba code to export from access to excel and have
the code use multiple excel tabs within a workbook????

Anyone have vba code that would create a temp table write
65,000 records to it, export those to excel, clean the temp
table, append the next 65,000 records, export it to excel with
a different name, clear the temp table, etc............ til
it gets all the records from the source table exported ???

thanks
bobh.

start here: http://www.mvps.org/access/modules/mdl0006.htm

You can set up a loop that creates a new worksheet, writes the
first 64Ki records, creates a second worksheet, writes the next
64Ki rows, until .EOF
--
Bob Quintal

PA is y I've altered my email address.
Mar 21 '06 #8
PCD
YOU think you are SO SMART!!!

Well you have made an A$$ of yourself first by showing that you can not
spell!!

Then you made an A$$ of yourself by claiming my reply was incorrect! All the
OP has to do is set up a query that segregates the data in his table in
blocks of 64K records and use the query as the data source in a series of
DoCmd.TransferS preadsheet .... statements or in a loop to put his data into
a series of worksheets in his workbook. This certainly will be faster than
your stupid recommendation of writing one field at a time to a cell in the
workbook!!!

You can kiss Arno R's A$$!!

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdata sheet.com
"Bob Quintal" <rq******@sympa tico.ca> wrote in message
news:Xn******** **************@ 207.35.177.135. ..
"PCD" <no***@email.co m> wrote in
news:KX******** ***********@new sread1.news.atl .earthlink.net:
Just a suggestion here -------

STOP making yourself look like an obsessed A#$&@# in front of
all the newsgroup readers!!!!


Well Steve,YOU made an A$$ of yourself by firing off another of
your incorrect replies, because the original poster was quite clear
in that he eexceeded the 64Ki record limit that your solution
suffers.

As long as you persist in posting erroneous answers that show your
incompetence above your advertising which violates newsgroup rules,
you are gonna get deservedly spanked.
--
Bob Quintal

PA is y I've altered my email address.

Mar 21 '06 #9
PCD
You're an obsessed A#$&@# !!! Why don't you just get lost. You don't
contribute anything to the newsgroup.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1150 users have come to me from the newsgroups requesting help
re******@pcdata sheet.com


"StopThisAdvert ising" <StopThisAdvert ising@DataShit> wrote in message
news:44******** **************@ text.nova.plane t.nl...

"PCD" <no***@email.co m> schreef in bericht
news:KX******** ***********@new sread1.news.atl .earthlink.net. ..
Just a suggestion here -------

STOP making yourself look like an obsessed A#$&@# in front of all the
newsgroup readers!!!!


Feeling lost and alone Steve??
Changed your nickname here again? ==>> Won't help that much....

We don't like you in this newsgroup. In fact *nobody* likes your behaviour
here.
So why don't you just get lost (I mean STOP) with your
advertising/jobhunting?

Arno R
Mar 21 '06 #10

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

Similar topics

3
9247
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
4
3949
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear" TEXT field that contains data such as 2000/01, 2001/02, etc. If I export a Query with this kind of data to Excel, it gives me the text value of this field; however, when I export a Report bound to this TEXT field, Excel gives me the values 36526,...
2
7711
by: G | last post by:
When I export data from access to excel by with "export" or "Analyze with" I seem to loose parts of some fields (long text strings). Is there a way to export it all to excel? Thanks G
2
8013
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
5
3102
by: Neil | last post by:
Hi I'm currently exporting my datagrid to excel, taking advantage of the fact that excel can render html, the problem is that when i click the button to export it opens in browser, I want the button to launch Excel and leave the browser as is Any help appreciate p.s. I know that this can be achieved by changing the settings on the client machine and de-selecting the 'browse in same window' for .xls extensions but this is not acceptable...
2
6930
by: Mustufa Baig | last post by:
Hi everybody, I have an ASP.NET website where clients can view their monthly billings by selecting different options. One of the option is the way they want to see the report i.e. whether they want to see it in PDF or EXCEL etc etc..... What I am trying to acheive is depending on their choice of format, I want to send the stream of that particulae selected format to the browser. I have tried couple od solutions but I couldn't able to get...
1
3167
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream As System.IO.MemoryStream = 3 myReport.ExportToStream( ExportFormatType.PortableDocFormat) 4 Response.Clear() 5 Response.Buffer() = True
2
2415
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform exporting ALL data from the datagrid control. Exporting data works fine when I show all data on the datagrid control. I'd like to shows only 30 records on the datagrid control instead of ALL data using page navigation, and perform exporting...
2
3184
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to set this up so as to do it reliably and minimize overhead? There are currently no constraints on the destination table. Assume the user or some configuration specifies the database name, server name, and filename+fullpath. The server is SQL...
4
2518
by: Tom | last post by:
I have a gridview on all of my web pages in my web app and they all export to excel. I have one page where the gridview is binding to a datatable that i created and only the first column is exporting to excel. How can I get the entire grid to export to excel?
0
9482
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
10062
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
9901
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
9878
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,...
1
7282
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
6551
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
5167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2694
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.