Exporting Access Report to XLS/XLSX file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alinagoo
    New Member
    • Apr 2010
    • 53

    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
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by alinagoo
    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
    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:\

    Code:
    DoCmd.OutputTo acReport, "rptMyReport", "MicrosoftExcel(*.xls)", "C:\myreport.xls", False, ""
    You can assign this to a button or whatever other event you choose

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32654

      #3
      Alinagoo reported your post as :
      Thanks
      It worked perfectly.

      Comment

      Working...