Run-time error 57121 HELP

brantjones6

New Member
Joined
Apr 4, 2019
Messages
3
I have created this macro and it works fine on my computer. However, I sent it to coworkers to use on their computers and it does not work.

Private Sub Workbook_Open()
'
' MoveDateBoxMain Macro
'


'
Sheets("Main").Activate
ActiveSheet.Shapes.Range(Array("DTPicker2")).Select
ActiveSheet.Shapes("DTPicker2").ScaleWidth 1.1, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("DTPicker2").ScaleWidth 0.9, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("DTPicker2").ScaleHeight 1.1, msoFalse, _
msoScaleFromTopLeft
ActiveSheet.Shapes("DTPicker2").ScaleHeight 0.9, msoFalse, _
msoScaleFromTopLeft

The line in the green text seems to be the issue from the debugger. Any help would be greatly appreciated!!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Have you tried

Code:
Private Sub Workbook_Open()
 with Sheets("Main")
  .Shapes.Range(Array("DTPicker2")).Select
  .Shapes("DTPicker2").ScaleWidth 1.1, msoFalse, msoScaleFromTopLeft
  .Shapes("DTPicker2").ScaleWidth 0.9, msoFalse,msoScaleFromTopLeft
  .Shapes("DTPicker2").ScaleHeight 1.1, msoFalse,msoScaleFromTopLeft
  .Shapes("DTPicker2").ScaleHeight 0.9, msoFalse, msoScaleFromTopLeft
end with
end sub
 
Upvote 0
What is the code meant to do?

Is it for resizing a control/shape on a worksheet?
 
Upvote 0
Michael,

I tried using that and I am still getting the Run-time error 57121 Application-defined or object-defined error.
 
Upvote 0
Norie,

Yes, this particular macro is meant to resize a date picker control. However, I have several other macros that are producing the same error when used on others computers.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

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