Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: Export a report to excel

    I have designed a report in Access, which i am happy with, one of the next requirements it to Analyze it in excel...

    is there a way to do the following :

    automatically export the report into excel without having to click the button on the toolbar,

    example:

    click button on my form to run the report ----> report opens ----> Analyze in Excel starts automatically.

    when i anaylzing the report in excel the formatting of the report is all over the place, can i set this up to auto tidy on opening..

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Post

    You can use the DoCmd.Output To command

    DoCmd.OutputTo acOutputReport, "yourReportName", _
    acFormatXLS, "c:\yourPath\file.xls"

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Put this code in the onClick event of a button for example

  4. #4
    Join Date
    Aug 2004
    Posts
    7

    Exporting Reports to Excel

    I tried
    DoCmd.OutputTo acOutputReport, "yourReportName", _
    acFormatXLS, "c:\yourPath\file.xls"

    and failed - the output had some column and some row headers, but no data.

    An Alternative, ugly as is sounds, is to output it to .rtf format (subb "RTF" for each "XLS" in the above, then copy & paste into excel.

    You'll probably want to redesign your report with extra controls here and there (Visible, but font=white) to force your report columns into their proper places in Excel. Even then, teh formatting will be poor, your pagination will be shot, forumlas will be gone. I checked the forum today looking for solutions to the latter two problems.

    Good luck!

    Galen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •