473,399 Members | 3,919 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,399 software developers and data experts.

Exporting Access Report to XLS/XLSX file

Hello All.
Who could help me to find out How can i convert an Access report to an Excel file(With VBA)?
Because my boss just interested to excel format and wanted me to locate a Command Button on the report for converting that report to an excel file!

thanks in advanced
May 13 '10 #1

✓ answered by Jim Doherty

@alinagoo
How complex is the report? If it is simple tabular material then look at the macro action OutputTo that will give you an idea of the arguments. If it suits your purposes you can convert it to VBA.

The following (converted macro action) command in VBA will output a report called rptMyReport to an excel file in the root of C:\

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acReport, "rptMyReport", "MicrosoftExcel(*.xls)", "C:\myreport.xls", False, ""
You can assign this to a button or whatever other event you choose

2 7448
Jim Doherty
897 Expert 512MB
@alinagoo
How complex is the report? If it is simple tabular material then look at the macro action OutputTo that will give you an idea of the arguments. If it suits your purposes you can convert it to VBA.

The following (converted macro action) command in VBA will output a report called rptMyReport to an excel file in the root of C:\

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acReport, "rptMyReport", "MicrosoftExcel(*.xls)", "C:\myreport.xls", False, ""
You can assign this to a button or whatever other event you choose
May 13 '10 #2
NeoPa
32,556 Expert Mod 16PB
Alinagoo reported your post as :
Thanks
It worked perfectly.
May 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Vikrant | last post by:
Hey Friends I need to export an Access Report using a filter. I am using the method OutputTo m_pDoCmd->OutputTo( 3, // asOutputReport COleVariant(strReportName), // <report name>...
5
by: feck | last post by:
Hi, Is there any code/routine to export a report as a word document retaining the formatting. I have a requirment to produce some fairly detailed statisitical reports for transmission by e-mail....
2
by: nofear | last post by:
I used to export my reports as snapshot but now I have to export them to Excel When I export my report to a Excel Spreadsheet the report header and footer are not included Only the data gets...
2
by: Composer | last post by:
This is not a question but rather an answer, or at least a clue. Like others, I had experienced seemingly random truncation of text when exporting a perfectly good Access report to RTF. Or...
4
akabir77
by: akabir77 | last post by:
Hi I am using the following code to convert a access report into HTML format and then sending it via email. DoCmd.SendObject _ acSendReport, _ ...
3
by: Bhujanga | last post by:
I need to create word documents from an Access Report. Below is the code that I am using. It works but there are problems. The page breaks generated by the report don't always line up just right with...
3
by: hawaiijeff | last post by:
I have a report that I built in Access 2002. I built it with the report wizard, but then went into design mode and added a extra information which was calculations off the existing fields in the...
5
by: Doogie | last post by:
Can anoyne tell me why this VBScript will create the file to Excel just fine, but the Excel file will not open up? I am saving it as a xlsx file instead of an xls one and I have the new version of...
3
by: nandithadevaraj | last post by:
When exporting a report to excel, is it possible to keep the properties around numeric values? More specifically - when exporting a report into excel, all of the numbers in a currency column are...
0
by: user1980 | last post by:
hello.. i am developing a page in asp to open an .xlsx file and display its contents.. i have used this connection string sConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.