Results 1 to 5 of 5
  1. #1
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128

    Run time error 3125 is not a valid name Make sure it does not include invalid characters and punctau


    I am trying to export a query to excel using transferspreadsheet. But it's giving me an error Run time error 3125 is not a valid name Make sure it does not include invalid characters and punctuation. I don't understand I am getting this error.

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, _

    "Query9", "C:\Users\John\Desktop\Charts\Book1.xlsx", -1

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    either acSpreadsheetTypeExcel12Xml (try another flag)
    or query9 does not exist
    or the path is invalid

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    From everything I read about the 'Run time error 3125", there might be some type of problem with the query.
    http://stackoverflow.com/questions/5...el-from-access

    Try deleting, then re-creating the query.

  4. #4
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128
    I tried to use another sample query and the code worked. So problem is in query. But I need to use the query. Why is giving me error in the query?

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    No idea, since all that you posted is the query name.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 01-20-2016, 12:41 PM
  2. Replies: 12
    Last Post: 04-17-2015, 11:41 AM
  3. Run time error '94': Invalid Use of Null... help
    By batowl in forum Programming
    Replies: 3
    Last Post: 05-14-2014, 01:58 PM
  4. Run-Time Error 3044 - Invalid Path?
    By KrenzyRyan in forum Import/Export Data
    Replies: 8
    Last Post: 01-19-2011, 10:03 AM
  5. VBA Import Error on Invalid Characters
    By jhrBanker in forum Import/Export Data
    Replies: 2
    Last Post: 11-25-2009, 12:07 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