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!
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