By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Exporting Access Report to XLS/XLSX file

P: 53
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

Share this Question
Share on Google+
2 Replies


Jim Doherty
Expert 100+
P: 897
@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
Expert Mod 15k+
P: 31,186
Alinagoo reported your post as :
Thanks
It worked perfectly.
May 13 '10 #3

Post your reply

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