+ Reply to Thread
Results 1 to 5 of 5

Error 424: Object Required on Application.Run

Hybrid View

CodSandwich Error 424: Object Required on... 01-29-2016, 12:27 PM
AlphaFrog Re: Error 424: Object... 01-29-2016, 01:22 PM
CodSandwich Re: Error 424: Object... 01-29-2016, 01:33 PM
AlphaFrog Re: Error 424: Object... 01-29-2016, 02:51 PM
CodSandwich Re: Error 424: Object... 01-29-2016, 03:28 PM
  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    Dover, NH
    MS-Off Ver
    2010
    Posts
    3

    Error 424: Object Required on Application.Run

    Hello,

    I have a procedure running off of a userform. Within that procedure, I am using Application.Run to call a sub in another workbook. When I step through my code, the Application.Run line to call the other sub works perfectly, the sub runs perfectly, but when my highlighted line is “End Sub” where it should transfer control back to my main procedure, it gives me Error 424: Object Required. Then, when I hit debug, the line that is highlighted as the problem is my original Application.Run line, which worked fine in the first place.
    Here’s my code:
    Select Case PartType
            Case "Nozzle Ring"
                   Select Case FrameSize
                        Case "HE300"
                            If Dir("G:\TES\Private\Quality Control\Jobs\Cummins CTT\300 Series Nozzle Rings\" & Input_PartNum, vbDirectory) = "" Then
                                MkDir ("G:\TES\Private\Quality Control\Jobs\Cummins CTT\300 Series Nozzle Rings\" & Input_PartNum)
                            End If
                            If Dir("G:\TES\Private\Quality Control\Jobs\Cummins CTT\300 Series Nozzle Rings\" & Input_PartNum & "\" & Input_JobNum) = "" Then
                                MkDir ("G:\TES\Private\Quality Control\Jobs\Cummins CTT\300 Series Nozzle Rings\" & Input_PartNum & "\" & Input_JobNum)
                            End If
    ‘The line below is where I call my sub in the other workbook
                            Application.Run("'Meas.Form-03_HE300 Verification Template_rev00.xlsm'!FillsCells", [Input_PartNum], [Input_JobNum], [Input_PotNum], [LabTechName]) = True
                            AWorkbk.SaveAs ("G:\TES\Private\Quality Control\Jobs\Cummins CTT\300 Series Nozzle Rings\" & Input_PartNum & "\" & Input_JobNum & "\" & Input_JobNum & ".xlsm")
    Here's the sub under the other workbook:
    Sub FillsCells(PartNum As Variant, JobNum As String, PotNum As String, LabTech As String)
    Sheet3.Range("B4") = JobNum
    Sheet3.Range("B5") = PartNum
    Sheet3.Range("G4") = Date
    Sheet3.Range("H5") = PotNum
    Sheet2.Range("D19") = LabTech
    I’m finding this all pretty confusing…which line is the error actually on? Does it have something to do with transferring control back to the procedure written in the userform? I’ve run the program omitting calling the sub under the other workbook entirely, and everything works great.

    Also: I know that in this line
    Application.Run("'Meas.Form-03_HE300 Verification Template_rev00.xlsm'!FillsCells", [Input_PartNum], [Input_JobNum], [Input_PotNum], [LabTechName]) = True
    the “=True” isn’t correct syntax. But VBA kept prompting me that my syntax was incorrect when I didn’t have it. It would say “Compile Error: Expected:=” and then when I just put an equals sign, it would say “Compile Error: Expected: Expression” So I just put “=True” in there to make it happy. Could that be the problem?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Error 424: Object Required on Application.Run

    Remove the = True and the surrounding parentheses.

    Application.Run "'Meas.Form-03_HE300 Verification Template_rev00.xlsm'!FillsCells", [Input_PartNum], [Input_JobNum], [Input_PotNum], [LabTechName]
    I don't know if that fixes your issue, but it should be a functional syntax.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    01-28-2016
    Location
    Dover, NH
    MS-Off Ver
    2010
    Posts
    3

    Re: Error 424: Object Required on Application.Run

    Thank you SO much! I thought it was going to be a lot more than a syntax issue.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Error 424: Object Required on Application.Run

    You're welcome and thanks for the feedback. Also, well done on how you expressed the problem. I wish other questions were as well constructed as yours was.

  5. #5
    Registered User
    Join Date
    01-28-2016
    Location
    Dover, NH
    MS-Off Ver
    2010
    Posts
    3

    Re: Error 424: Object Required on Application.Run

    I appreciate that! I get laughed at for drafting things before I send them, I am glad it is paying off.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. application.vlookup returns Run-error: Object required
    By Casedias in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2015, 09:39 AM
  2. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  3. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  4. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  5. Object Required error on Application.Match function.
    By ctckark1 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-12-2011, 11:01 AM
  6. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 PM
  7. [SOLVED] run-time error '1004': Application-defined or object-deifined error
    By rich5665@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2005, 05:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1