Regression Macro Stops Unexpectedly

EnergyModeler

New Member
Joined
Aug 16, 2019
Messages
7
Hello,

I created a macro to run a linear regression automatically, and when I execute the code it works properly. However, when a coworker tries, it is as if the macro stops unexpectedly with no error or anything. It just doesn't continue on. This is a snippet of the code. It completes the Application.Run but stops at the Range.Select that follows. Any help would be appreciated!

Code:
Dim x1 As Long, y1 As Long
    x1 = Range("M" & Rows.Count).End(xlUp).Row
    y1 = Range("O" & Rows.Count).End(xlUp).Row


    Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("M5:M" & x1), _
        ActiveSheet.Range("O5:S" & y1), False, False, , "", False, False, _
        False, False, , False
    
    Range("B17:B22").Select
    Selection.Copy
    Sheets("Data").Select
    Range("U4").Select
    ActiveSheet.Paste
    ActiveWindow.SmallScroll Down:=-12
    Application.CutCopyMode = False
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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