Export Report with Graph to Excel error 2495

Discussion in 'Access' started by Studentp, May 28, 2016.

  1. Studentp

    Studentp

    Joined:
    May 28, 2016
    Messages:
    2
    Likes Received:
    0
    Hi, I'm beginner in coding and Access. I have to export Report with a graph into Excel, but I'm getting this error 2495 ' The action or method required a Table Name argument.' below should be my code that I using right now. I hope to find any solution, that could help me in my project.

    Private Sub Command10_Click()
    Dim reportname As String
    Dim theFilePath As String
    reportname = "Report1"
    theFilePath = "C:\Users\DDPP\Desktop\"
    theFilePath = theFilePath & reportname & "_" & Format(Date, "yyyy-mm-dd") & ".xls"

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel11, Report1, theFilePath, True
    End Sub
     
    Studentp, May 28, 2016
    #1
    1. Advertisements

  2. Studentp

    Studentp

    Joined:
    May 28, 2016
    Messages:
    2
    Likes Received:
    0
    Now I getting error 3011......
     
    Studentp, May 29, 2016
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.