Results 1 to 7 of 7
  1. #1
    niki09 is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    10

    Access 2007 DoCmd.OutputTo acOutputReport ... acFormatXLS

    I found a post in this forum on out outputting a report to Excel using access 2007, saying that it does not work.

    This is what I am trying to do with access 2007 (hoping that the problem has now been fixed):
    DoCmd.OutputTo acOutputReport, "total", acFormatXLS, "c:\personal\pdf_files\report.xls", True
    The error says access cannot save the data to the output file.

    If I go to the Report itself, and right click, I can save it as excel.
    So perhaps it now does work in vb but I have got something wrong.




    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Is the computer on a network? Is the db on the network server? Sometimes things that can be done manually are not allowed by the network when done programmatically as with VBA.

    Try saving to the C:\ root level and see if the command works.
    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
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Alternatively, I would attempt to use Docmd.TransferSpreadsheet.

    Look here for a syntax tutorial. https://msdn.microsoft.com/en-us/lib.../ff844793.aspx

  4. #4
    niki09 is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    10
    thank you for the suggestions.
    no joy with trying to save to the root directory.
    my computer is a stand alone machine.
    Transfer spreadsheet could not work (as I am trying to save a report as an excel, rather than table?)

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Don't know what to tell you. I am sure the method worked for me when I had 2007.

    Is the report open in PrintPreview?
    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.

  6. #6
    niki09 is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    10
    Dear group, I get emails from your system on this topic. The last reply was essentially we do not know, which is fine. Can someone close this please.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Closing locks a thread and prevents new posts. Seldom do this.
    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. Replies: 1
    Last Post: 07-30-2015, 12:56 PM
  2. Replies: 5
    Last Post: 06-29-2015, 11:30 AM
  3. DoCmd.OutputTo acOutputReport
    By GraeagleBill in forum Reports
    Replies: 11
    Last Post: 09-15-2012, 07:33 PM
  4. DoCmd.OutputTo
    By tylerg11 in forum Reports
    Replies: 2
    Last Post: 08-09-2012, 12:22 PM
  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