Results 1 to 3 of 3

Thread: Export Reports from MS-Access to MS-Excel

  1. #1
    Join Date
    Mar 2007
    Posts
    1

    Export Reports from MS-Access to MS-Excel

    Hi,

    I would like to know how can we export Reports from MS-Access to MS-Excel. could you please help me

    Thanks,
    Bhaskar

  2. #2
    Join Date
    May 2006
    Posts
    407
    If it is a query you want exported, try TransferSpreadsheet in the help file. If it is an Access Report, then try SendTo, again, in Access help.
    After reading up on these, if you have any other questions, please ask.
    Vic

  3. #3
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275

    Smile Re:Export Reports from MS-Access to MS-Excel Reply to Thread

    Bhaskar

    I would not recommend exporting a report straight to excel as the excel spreadsheet takes the same format as the report e.g. any group by appears in one column, any format that you did to a field also appears formatted.

    I would suggest as per the previous reply to export using a query or use a table.

    To transfer a table here is some sample code
    DoCmd.TransferSpreadsheet acExport, 8, "tbl_loadings_ss", "c:\projects\exported_spreadsheet.xls", False, ""

    tbl_loadings_ss is the name of the table to be exported
    the location of the spreadsheet is
    "c:\projects\exported_spreadsheet.xls"



    Export query
    DoCmd.OutputTo acOutputQuery, "your_query", acFormatXLS, "c:\projects\exported_spreadsheet.xls", True

    Now if you want to open the spreadsheet after your export, here is some code to use in your module.

    Dim app_name As String

    app_name = "c:\program files\microsoft office\office\excel.exe " & " c:\projects\exported_spreadsheet.xls"

    Call Shell(app_name, 1)

    the app name is the location of your excel.exe file it maybe in a different location on your computer.

    If you need any help just ask.

    Allan

Posting Permissions

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