• DoCmd.OutputTo – Operation not available

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » DoCmd.OutputTo – Operation not available

    Author
    Topic
    #462170

    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:MyReportsMyExport.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.

    Viewing 1 reply thread
    Author
    Replies
    • #1175327

      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”

    • #1175389

      I’ve run into the message using OutputTo while generating reports. In every instance the the source recordset was empty.

      Marty

    Viewing 1 reply thread
    Reply To: DoCmd.OutputTo – Operation not available

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: