Ms Access Error 40351
Forum Microsoft Office Application Help - Excel Help forum Excel Programming / VBA / Macros error 40351 on one machine but not other To get replies by our experts at nominal charges, follow this link to buy points and post your thread in our Commercial Services forum! Here is the FAQ for this forum. + Reply to Thread Results 1 to 7 of 7 error 40351 on one machine but not other Thread Tools Show Printable Version Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 10-02-2008,01:45 PM #1 DKY View Profile View Forum Posts Forum Contributor Join Date 09-19-2004 Posts 252 error 40351 on one machine but not other I am running the following code Please Login or Register to view this content. and this code is being accessed through a network drive by putting a shortcut in the XLSTART folder of two different machines. The problem is that I get the following error Run-time error ‘40351’: Application-defined or object-defined error on one machine and not on the other. I'm trying to figure out why. The error procedes to highlight this line of code Please Login or Register to view this content. Any suggestions? Last edited by DKY; 10-06-2008 at 01:31 PM. Register To Reply 10-02-2008,03:43 PM #2 Kenneth Hobson View Profile View Forum Posts Visit Homepage Forum Expert Join Date 02-05-2007 Location Tecumseh, OK MS-Off Ver 2016 Posts 1,814 Try running it in debug. Or, put a line before it to print to the Immediate window: Please Login or Register to view this content. Register To Reply 10-02-2008,03:59 PM #3 DKY View Profile View Forum Posts Forum Contributor Join Date 09-19-2004 Posts 252 Okay, I'm not sure how to run in debug mode but I stepped through the program with the F8 and put that line of code in there. I hit ctrl+G to display some window called "intermediate" and it showed me the value for "Range(strletter & i)" on both my machine and the machine having troubles. The only difference is t
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office Add-in Availability Office Add-ins Changelog Microsoft Graph API Office 365 Connectors Office 365 REST APIs SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Any way to run an Access VBA Subroutine/Function/Method from within Excel VBA? Microsoft Office for Developers > Access for Developers Question 0 Sign in http://www.excelforum.com/showthread.php?t=657461 to vote Is there any way to call an Access VBA subroutine, function or Class Method from within an Excel VBA routine? In Access, by using Tools, References, I can add-in subs, functions, classes from other databases, but when in Excel, Outlook, etc. VBA, I'm unable to jump across applications to invoke references to Access databases. Many thanks in advance if anyone knows a way I can https://social.msdn.microsoft.com/Forums/office/en-US/d90a9bbb-c2d7-4ed1-a6dd-2bb1905a3b89/any-way-to-run-an-access-vba-subroutinefunctionmethod-from-within-excel-vba?forum=accessdev run a program in an Access database from within Excel? DragonForest Wednesday, April 18, 2012 6:33 AM Reply | Quote Answers 2 Sign in to vote As written, Excel and Access need to be in the same directory. Access need not be open. In Excel:- Option Explicit Private Sub cmdCallAccessSub_Click() Dim strDBName As String Dim strMessage As String strDBName = ThisWorkbook.Path & "\" & "TestAccess_A2003.mdb" With CreateObject("Access.Application") .OpenCurrentDatabase strDBName .Run "Invoke", "CalledFromExcel", strMessage .Quit End With MsgBox strMessage End Sub In Access:- Option Explicit Option Compare Text Public Sub Invoke(ByVal strSubName As String, _ ByRef strReturnMessage As String) Dim strReturn As String On Error Resume Next Application.Run strSubName, strReturn If (Err.Number) Then strReturnMessage = Err.Description Err.Clear Else strReturnMessage = strReturn End If End Sub Public Sub CalledFromExcel(ByRef strReturn As String) On Error Resume Next strReturn = "Returned message from Access." End Sub Chris. Brisbane Australia, GMT+10, Access 2003 Marked as answer by DragonForest Wednesday, April 18, 2012 12:09 PM Edited by Chris A O'Brien Wednesday, April 18, 2012 9:29 PM Wednesday, April 18, 2012 11:52 AM Reply | Quote 1 Sign in to vote For functions / subs you co
Visual SourceBook Total Access Speller Total Access Startup Total Access Statistics Multi-Product Suites >> Overview of Suites Total Access Ultimate Suite Total Access Developer Suite Total Visual Developer Suite Visual Basic 6 >> Total Visual Agent http://www.fmsinc.com/microsoftaccess/errors/errornumber_description.html Total Visual CodeTools Total Visual SourceBook Total VB Statistics Multi-Product Suites >> Overview of http://stackoverflow.com/questions/2905023/open-an-access-database-and-run-one-of-its-macros-from-excel Suites Total Visual Developer Suite Total Visual Enterprise Suite Sentinel Visualizer Total ZipCode Database Catalog and Fliers Product Awards Product Reviews Product User Matrix Pre-Sale FAQs Version Compatibility Chart Language Support User Manuals Order News Announcements Current Newsletter Upcoming Events Product Reviews Media Videos Free Resources Overview Product Demos Microsoft Access Developer Help Center Microsoft Access ms access Query Help Center Microsoft Access to SQL Server Upsizing Microsoft Outlook Tips Technical Whitepapers Tips and Techniques Technical Videos Consulting Overview Success Stories Technical Expertise Microsoft Access About About Us Contact Us Why Choose FMS? Awards Quality Pledge Microsoft Access Developer Center Strategic Overview Microsoft Access within an Organization's Database Strategy Microsoft Access vs. Excel How many simultaneous Microsoft Access users? Blaming Microsoft Access instead of the Developer History ms access error of Access Microsoft Access Versions, Service Packs and Updates How Access Started Microsoft Access and Office 2010 SP2 Issues Top 14 Features Added with MS Access 2007 Best Practices Taking Over Legacy MS Access Databases 100+ Performance Tips Winner of Every Best Access Add-in Award Split Database Architecture for Multiuser Find and Delete Unused Objects and VBA Code Table Design Designing Primary Keys Field Type Consistency Table Normalization Tips Taking Time into Account Temporary Data Transposing Data Set AutoNumber Starting Number Other than 1 Avoid Unnecessary or Duplicate Indexes Replace Attachment Field Paperclip Icon Avoid Decimal Data Types Query Design Microsoft Access Query Tips and Techniques Form Design Form Tips and Mistakes Module VBA to Forms and Controls Form Navigation Caption Using a RecordsetClone Synchronize Two Subforms Multiple OpenArgs Values Late Bind Tab Subforms Subform Reference to Control Rather than Field Tab Page Reference Shortcut Keys Combo Box Top Tips Properties and Validation Select First Item Cascading Combo Boxes Zip, City, State AutoFill Report Design Suppressing Page Headers and Footers on the First Page of Your Report Add the NoData Event Annual Monthly Crosstab Columns Design Environment Adding Buttons to the Quick Access Toolbar Collapsing the Office Ribbon for more space VBA Programming Using Nz() to H
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 Open an Access database and run one of its Macros from Excel up vote 1 down vote favorite 1 From Excel, I need to open an Access database and run one of the database's macros. I'm using Excel and Access 2007. Here is my code in Excel: Sub accessMacro() Dim appAccess As New Access.Application Set appAccess = Access.Application appAccess.OpenCurrentDatabase "C:\blah.mdb" appAccess.Visible = True appAccess.DoCmd.RunMacro "RunQueries.RunQueries" appAccess.CloseCurrentDatabase End Sub In the Access Database, there is a procedure named RunQueries in a module named RunQueries. Each time I run this, I get the following error: Runtime error '2485': Microsoft Access Office can't find the object 'RunQueries.' I have also tried: appAccess.DoCmd.RunMacro "RunQueries" and I get the same errors message. Any idea how to do this? By the way, I could go into a long explanation about why I need to do this, but let me just say that I've already argued against it, and I have to do it this way (meaning, I have to use Excel as a frontend to open several Access dbs and run their macros). vba excel-vba access-vba share|improve this question asked May 25 '10 at 13:27 oob 1,22821941 This question waits to be closed :-) –iDevlop Dec 17 '14 at 8:21 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote What about this syntax ? appAccess.run "RunQueries.RunQueries" By the way, I always avoid naming a module like a procedure. This