Results 1 to 7 of 7
  1. #1
    Stan2man is offline Novice
    Windows 2K Access 2007
    Join Date
    Nov 2011
    Posts
    4

    Ms Access 2007 report export to excel 2007


    Hi is there a way to export a list (record set) of report from access 2007 to excell, keeping the format. I would like to automate the process using VBA.

    Note : if you need a copy of the database I can send it, thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Not sure what you mean by 'keeping the format'. There is a lot out there on this topic. Google: VBA Access export query. Here is one http://www.ehow.com/how_7438797_acce...ort-query.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Stan2man is offline Novice
    Windows 2K Access 2007
    Join Date
    Nov 2011
    Posts
    4
    Thanks June, but I would like to export reports from access to excell, not query. If you have any idea on how to do so. Just let me know

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You can use the Export wizard. The output will not look quite like the rendered Access report because the export does not take Report and Page header info (seems like it used to in 2003) and data is put into cells. The report must be open in ReportView not PrintPreview to make the wizard available.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Stan2man is offline Novice
    Windows 2K Access 2007
    Join Date
    Nov 2011
    Posts
    4
    Thanks June7 for your quick answer, but I would like to know is there a way to do the samething using VBA, because I need to run the export several time. And also the report that will be call with the command contains a query that use a parameter (project_num).

    So exactly I will have to run through a recordset that contains the project number
    and produce an excell file for each project number.

    Is it possible to export a report using TransferSpreadsheet acExport??

    Thanks

    Stan

  6. #6
    Stan2man is offline Novice
    Windows 2K Access 2007
    Join Date
    Nov 2011
    Posts
    4
    Heres the command I'm trying to use : DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "report_name", "C:\Book1.xls", False, "Sheet2$"

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I don't remember if that works. The report might have to be open first. Might require DoCmd.OutputTo acReport
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access to Excel 2007 export annoyance
    By jim wv in forum Import/Export Data
    Replies: 3
    Last Post: 10-14-2011, 09:48 AM
  2. Replies: 3
    Last Post: 08-18-2011, 05:04 PM
  3. Export to Text File Using DoCmd Access 2007
    By tonere in forum Programming
    Replies: 1
    Last Post: 03-30-2011, 06:14 PM
  4. Access 2007 Export weirdness - need help
    By Longwell in forum Access
    Replies: 1
    Last Post: 10-17-2010, 11:13 AM
  5. Replies: 0
    Last Post: 11-17-2009, 02:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums