Ms Access Runtime Error 3125
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Run-time error 3125 when exporting to Excel from Access up vote 0 down vote favorite I'm exporting a file from Access to Excel, using the following code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "" & strQuery & "", "" & result & "", True strQuery is the name of the Query that the exported file is based on, and result is the file name and address, gained from a Save As dialog. There are two potential queries I'd want to use, depending on the user's search criteria. When using the first query, Report, it works fine. When using the second query Report2, it throws up an error: Run-time error '3125' '' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. The Report2 query works fine when run by itself, and as part of a subform, just not on this export. Any ideas as to what I'm doing wrong? Thanks in advance. ms-access ms-access-2007 runtime-error share|improve this question asked Apr 19 '11 at 9:06 BFWebAdmin 2,12763167 1 Try getting rid of the quote marks around the query text, you should not need them. So it should now read DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, strQuery , "" & result & "", True. If that fails try a hard typed export path –Kevin Ross Apr 19 '11 at 10:47 Thanks - but ultimately it seems to have been a problem with the query rather than the code above. I've rebuilt the query from the ground up and things appear to be working now, –BFWebAdmin Apr 19 '11 at 11:30 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Browse other questions tagged ms-access ms-access-2007 runtime-error or ask your own question. asked 5 years ago viewed 1904 t
Community Links Social Groups Pictures & Albums Members List Calendar Search Forums Show Threads Show Posts Tag Search Advanced Search Find All Thanked Posts Go to Page... Thread Tools Rate Thread Display Modes 07-25-2006, 12:54 AM #1 aziz rasul Newly Registered User Join Date: Jun 2000 Location: Earth Posts: 1,649 Thanks: 16 Thanked 1 Time in 1 Post TransferSpreadsheet Run time Error 3125 I have the following code: - DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblIREMarginalReportTemp", _ "M:\MS Excel Files\GP\Ireland\Ire Wk 2 2006\IRE MR http://stackoverflow.com/questions/5714026/run-time-error-3125-when-exporting-to-excel-from-access 2 06.xls", False, "'Working Document'!" When I run the code I get the error: - Run-time error '3125': "Working Document'$' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. Does anyone understand why I get this? __________________ Aziz “Do not the Unbelievers see that the heavens and the http://www.access-programmers.co.uk/forums/showthread.php?p=508945 earth (meaning the universe) were (once) one single entity (ratq), which We (meaning God, the Creator) then parted asunder (fataqa) and We got every living thing out of water. Will they then not believe?” Qur’an - Surah al-Anbiyaa (The Prophets) 21:30 See also 24:45 and 25:54. aziz rasul View Public Profile Find More Posts by aziz rasul 07-25-2006, 04:14 AM #2 namliam The Mailman - AWF VIP Join Date: Aug 2003 Location: Amsterdam/The Netherlands Posts: 11,388 Thanks: 0 Thanked 796 Times in 783 Posts It is probably the ! ... It should either not be there or be within the single quotes Greets namliam View Public Profile Visit namliam's homepage! Find More Posts by namliam 07-25-2006, 04:54 AM #3 aziz rasul Newly Registered User Join Date: Jun 2000 Location: Earth Posts: 1,649 Thanks: 16 Thanked 1 Time in 1 Post Silly me. It should have been DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblIREMarginalReportTemp", _ "M:\MS Excel Files\GP\Ireland\Ire Wk 2 2006\IRE MR 2 06.xls", False, "'Working Document!'" i.e. inside the single quotes. Thanks. __________________
DriverDoc WinSweeper SupersonicPC FileViewPro About Support Contact Errors Troubleshooting › Runtime Errors › Microsoft Corporation › Microsoft Access › Error 3125 How To Fix Microsoft Access Error 3125 Error Number: Error 3125 Error Name:|' is not a valid name Error Description: http://www.solvusoft.com/en/errors/runtime-errors/microsoft-corporation/microsoft-access/3125-is-not-a-valid-name/ |' is not a valid name. Make sure that it does not include http://www.pcreview.co.uk/threads/re-odd-transferspreadsheet-error-msg-3125-not-a-valid-name.3550524/ invalid characters or punctuation and that it is not too long. Developer:Microsoft Corporation Software:Microsoft Access Applies to:Windows XP, Vista, 7, 8 Download NowWinThruster 2015 - Scan your PC for computer errors. Compatible with Windows 10, 8, 7, Vista, XP and 2000 Symptoms of Error 3125 "Error 3125" appears and crashes the active program window. ms access Your PC frequently crashes with Error 3125 when running the same program. “|' is not a valid name” is displayed. Windows runs sluggishly and responds slowly to mouse or keyboard input. Your computer periodically “freezes” for a few seconds at a time. These 3125 error messages can appear during program installation, while a Microsoft Corporation-related software program (eg. Microsoft Access) is running, during Windows startup or shutdown, or ms access runtime even during the installation of the Windows operating system. Keeping track of when and where your 3125 error occurs is a critical piece of information in troubleshooting the problem. Causes of Error 3125 Corrupt download or incomplete installation of Microsoft Access software. Corruption in Windows registry from a recent Microsoft Access-related software change (install or uninstall). Virus or malware infection that has corrupted Windows system files or Microsoft Access-related program files. Another program maliciously or mistakenly deleted Microsoft Access-related files. Runtime Errors such as “Error 3125” can be caused by a variety of factors, so it is important that you troubleshoot each of the possible causes to prevent it from recurring. Runtime Errors Knowledgebase Article ID: 121018 Article Author: Jay Geater Last Updated: 18-07-2016 Popularity: star rating here Download NowError Fix Learn More Tweet Recommendation: Scan your PC for computer errors. How To Fix Microsoft Access Error 3125 Below is a list of troubleshooting steps to resolve your Error 3125 problems. These troubleshooting steps get progressively more difficult and time consuming, so we strongly recommend attempting them in ascending order to avoid unnecessary time and effort. Please Note: Click the [ ] image to expand the troubleshooting instructions for each step below
2008. Klatuu Guest The problem is the ' in the name. Access is trying to use that as a string delimiter. The $ can be used in range names to denote SheetName$A3:Z99 It is converting the ! to $. -- Dave Hargis, Microsoft Access MVP "ragtopcaddy via AccessMonster.com" wrote: > Here is my TransferSpreadsheet code: > > DoCmd.TransferSpreadsheet _ > TransferType:=acExport, _ > SpreadSheetType:=acSpreadsheetTypeExcel9, _ > TableName:="qryLeaseEventStores", _ > FileName:=strRptPath, _ > HasFieldNames:=True, _ > Range:="'Lease Events'!A3" > > I get Run-time error '3125': > > ''Lease Events'$A3' is not a valid name. > First of all, I didn't use the $ character. Why does it misinterpret a ! as a > $ character? > > -- > Bill Reed > > "If you can't laugh at yourself, laugh at somebody else" > > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-externaldata/200806/1 > > Klatuu, Jun 25, 2008 #1 Advertisements Klatuu Guest Use Brackets "[Lease Events]!A3" -- Dave Hargis, Microsoft Access MVP "ragtopcaddy via AccessMonster.com" wrote: > Does the space in the name, "Lease Events", not necessitate the use of the 's > ? > > How then should I alter my string, "'Lease Events'!A3"? > > Klatuu wrote: > >The problem is the ' in the name. Access is trying to use that as a string > >delimiter. > >The $ can be used in range names to denote SheetName$A3:Z99 > >It is converting the ! to $. > >> Here is my TransferSpreadsheet code: > >> > >[quoted text clipped - 11 lines] > >> First of all, I didn't use the $ character. Why does it misinterpret a ! as a > >> $ character? > > -- > Bill Reed > > "If you can't laugh at yourself, laugh at somebody else" > > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-externaldata/200806/1 > > Klatuu, Jun 25, 2008 #2 Advertisements Klatuu Guest I thought the bracketing would do it. Have you tried with no delimiters at all? This is a result of poor naming, that is using spaces in names. But, maybe you don't have control over that. -- Dave Hargis, Microsoft Access MVP "ragtopcaddy via AccessMonster.com" wrote: > Thanks for your help, Klaatu. > > I used the brackets and got: > > Run-time error '3126': > > Invalid bracketing of name ". > > I wonder what that " means in the error msg. > > Bill > > Klatuu wrote: > >Use Brackets > >"[Lease Events]!A3" > >> Does the space in the name, "Lease Events", not necessitate the