ActiveX buttons keep moving in Excel 2010

lattechic

New Member
Joined
Jun 24, 2018
Messages
14
Hi experts! I've searched the old posts regarding this problem but I can't find the right fix. I have multiple worksheets with buttons and they keep resizing after I generated them in PDF forms. I've set the "Don't move or size with cells", placement property to 3 and tried to use this code which I found somewhere :)

So, I have a userform with print button. User then selects which worksheet to print as PDF, presses OK which triggers the FixButtons routine to fix the size.

Code:
Sub FixButtons()


Dim wsname As String
Dim ws As Worksheet


Set ws = Worksheets("Lookup")


For i = 2 To 8


wsname = ws.Cells(i, 19)


'overnight- select button fix
Sheets(wsname).Shapes("cmdSelect").Top = 62
Sheets(wsname).Shapes("cmdSelect").Left = 699
Sheets(wsname).Shapes("cmdSelect").Width = 81
Sheets(wsname).Shapes("cmdSelect").Height = 22
Sheets(wsname).OLEObjects(1).Object.Font.Size = 10


'overnight- reorder button fix
Sheets(wsname).Shapes("cmdReorder").Top = 93
Sheets(wsname).Shapes("cmdReorder").Left = 699
Sheets(wsname).Shapes("cmdReorder").Width = 81
Sheets(wsname).Shapes("cmdReorder").Height = 22
Sheets(wsname).OLEObjects(2).Object.Font.Size = 10


Next i


End Sub

But when I check the worksheet, the buttons changed its size and moved to the far top left side. Still not working! Please help.

Thanks in advance.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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