473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Exporting a Report to Excel

Hi there,

Please, how can I export a report from access to excel? Is there a
command to do this?
A sample would be very appreciated.

Thanks in advance.
Ottoni.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
3 12927
right-click on the report, choose Export, Choose Excel as the
destination file type.

Nov 13 '05 #2
Sorry, I want to do this through a VBA macro.
Can anyone help?

Thanks.
Ottoni.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3
Some interesting reading...

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

For a single report:

Function basSendReportToExcel()
On Error GoTo basSendReportToExcel_Err

' Output a single report to Excel
DoCmd.OutputTo acReport, "Pledge Listing",
"MicrosoftExcelBiff8(*.xls)", "C:\Documents and
Settings\user\Desktop\xlsReport.xls", False, "", 0
basSendReportToExcel_Exit:
Exit Function

basSendReportToExcel_Err:
MsgBox Error$
Resume basSendReportToExcel_Exit

End Function

Yes, I read that you wanted to do this in a macro. Except you can't
cut & paste steps from a macro to anywhere. Otherwise, if you have to
use macros, check out the OutputTo command.

If you're outputting a lot of reports to the same SS, you might want to
check out something like this:

Public Sub EnumerateReports()
Dim aobj As AccessObject
For Each aobj In CurrentProject.AllReports
'--process the report here - export or whatever.
DoCmd.OutputTo acReport, aobj.Name,
"MicrosoftExcelBiff8(*.xls)", "C:\Documents and
Settings\user\Desktop\xlsReport.xls", False, "", 0

Next aobj

End Sub

Nov 13 '05 #4

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

Similar topics

0
by: Ali Eghtebas | last post by:
Hi, I tried this demo application in here (watch for any line breaks in the URL): (http://support.crystaldecisions.com/communityCS/FilesAndUpdates/vbnet_win_a dodotnet.exe.asp When exporting...
0
by: Amber | last post by:
I found a sample on dynamic reporting to a datagrid and exporting to excel. For those who are into reporting into Excel. This web tool allows for adhoc select statements and reports. ...
2
by: deko | last post by:
I use a complied query to export to Excel like this: SELECT * INTO . FROM tblExcelData; But I have a situation where I need to export several tables into the same worksheet. The idea is to...
1
by: ad | last post by:
I use the code below to export the content of a data set to Excel, the code come form http://www.dotnetjohn.com/articles.aspx?articleid=36 But it always use the web form's name as the default...
2
by: Rez | last post by:
Hi Guys, I have a problem with exporting to excel from a modal dialog box. Basically, i have an ASPX page that gathers user criteria, and passes it to a dialogbox (showModalDialog), There is a...
1
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...
6
by: Kevin Humphreys | last post by:
Hi There, I am trying to export a recordset to an excel file using the Content Type below in the header. Response.ContentType = "application/vnd.ms-excel" Which works fine however the...
6
by: Opa | last post by:
Hi, I have a DataGrid, whose sourceI am exporting to Excel. This works fine except for the Column ordering. My datasource is not a datatable, with a typical SELECT statement where I can...
4
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...
3
by: jennwilson | last post by:
Access 2000 - I have developed a database that houses patient information. The patient information must be sent in an excel file to another company department. I know how to export my data to Excel...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
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
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...

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.