Wierd discovery about Command Buttons

raymond30031

New Member
Joined
Jan 19, 2011
Messages
20
Hello,

I have a activeX command button name commandbutton1
When I click on it,
1. it unprotect the sheet
2. shows preview of the chart
3. protect the sheet

Here is the code
Code:
Sheet5.Unprotect
Sheet5.ChartObjects("Chart 8").Chart.PrintPreview
Sheet5.Protect

The codes work fine, no error occurs, but the odd part is after I exit the preview screen, every command button on that sheet shifts (moves) to a different place. Either they move up, right , left, or down. The point is that it shouldnt move from where I have placed it. Or should it?

Does anyone has any clue?

Thank you
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Re: Weird discovery about Command Buttons

I experienced a similar thing using ActiveX comboboxes when I rolled out a workbook to a number of users a while ago. They were all using Excel 2007 under WinXP but a mixture of different computers, graphics cards, monitors, etc. Sometimes the comboboxes would slowly edge their way in one direction or another each time the workbook was loaded, sometimes they would get smaller and eventually vanish into a dot.

I ended up having to resize and reposition them every time the workbook was loaded.
 
Upvote 0
Re: Weird discovery about Command Buttons

I would generally recommend you avoid ActiveX controls on worksheets if at all possible and use Forms ones instead.
 
Upvote 0
Yea, I am experiencing the problem and i am wondering if there is a fix for it?
I am thinking of fixing the button to a position but i do not know how to code that
Any clue?
 
Upvote 0
Either on the Developer tab (XL2007+) or the Forms toolbar (XL2003-).
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,513
Members
452,921
Latest member
BBQKING

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