Application.Run error

NSKATC

New Member
Joined
Mar 2, 2017
Messages
2
Hi everyone, I am trying to run the same macro several times, but keep getting the error: The macro may not be available in this workbook or all macros may be disabled. I have enabled everything, so not sure what I am missing. The "Enter" button is in a userform.

Code:
Private Sub EnterButton1_Click()
    Application.Run "StatusUpdate"
End Sub


Sub StatusUpdate()
' Enter status update (person/task) into table
    If Range("ChuckQty") > 12 Then
        If ComboBox_All_Personnel_13 <> "" Then
        Range("Table1[[#Headers],[Current Status (person)]]").Offset(13, 0).Select
        Selection.Value = ComboBox_All_Personnel_13.Value
        End If
        Range("Table1[[#Headers],[Current Status (task)]]").Offset(13, 0).Select
        If ComboBox_Status_Testing_13 <> "" Then
            Selection.Value = ComboBox_Status_Testing_13.Value
            ElseIf ComboBox_Status_Analysis_13 <> "" Then
                Selection.Value = ComboBox_Status_Analysis_13.Value
        End If
    End If
End Sub

The macro works fine on its own without the Application.run, but I am going to have to use it multiple times and would only like it in there once.

Thanks!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Do you really need Application.Run?

Can't you just call the sub?
Code:
Call StatusUpdate

Note, if you are using Application.Run because the sub is in another workbook you need to prefix the sub name with the workbook name.

For example.
Code:
Application.Run "Book1.xls!StatusUpdate"
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,344
Members
448,570
Latest member
rik81h

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top