Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    MS Access 2002

    Part of my application loops through customers and creates a table for each then exports it in XLS format. I use this line to export:

    DoCmd.OutputTo acOutputTable, "tbl_MyTable", acSpreadsheetTypeExcel9, "C:\MyReports\MyExport.xls"

    This works well except for the very first export. I get a message that states:
    "This operation is not available at this time..."

    I break the code, manually export the table, then restart the code and all subsequent exports work without a problem.

    I tried putting a save command prior to the export to see if that was the problem and it did not make a difference.
    DoCmd.Save acTable, "tbl_MyTable"

    I checked to be sure the output path exists.
    "C:\MyReports\"

    Any idea why the first export is causing this issue?

    As always, thanks in advance for your assistance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Perhaps the export is too soon after creating the table. Does it help if you insert a MsgBox statement before the export, e.g.

    MsgBox "Click OK to continue"

  3. #3
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Sacramento, CA
    Posts
    193
    Thanks
    3
    Thanked 1 Time in 1 Post
    I've run into the message using OutputTo while generating reports. In every instance the the source recordset was empty.

    Marty

Posting Permissions

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