Active X Command Button Misbehaving

randumhero

New Member
Joined
Feb 21, 2019
Messages
3
Hello All,

First time poster here - maybe there will be a kind soul that can help me with this strange issue.

I was attempting to create a command button to display a userform for a project I'm working on, but was getting some strange behavior out of the button that I couldn't figure out. Instead of messing with it in the project file further, I just tried creating a basic active x command button in a blank worksheet to display a blank userform to see if the behavior was inherent to the project file I was working on... it wasn't - hence my question (see below).



I created a command button with this simple code behind it. This code is contained in the worksheet object.

Private Sub CommandButton1_click()

UserForm1.Show

End Sub

When I click the button the button duplicates itself to the upper left of the original button and disappears upon release of the mouse click. So, clearly it is not initiating the code above... To make matters even stranger, if I enlarge the size of the original button to be large enough that the duplicate overlaps. The duplicate does not disappear upon release; it remains. Further, I can then click this duplicate button and userform1 appears as originally intended.

I am thoroughly confused:confused:... any help would be much appreciated!

Thanks.
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
Welcome to the site!

Do you have any other code on the sheet or in the userform?

You could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Last edited:

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
No, I dont have the problem. I press the button and it does not duplicate.:confused:

What version do you have of excel?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,578
Office Version
  1. 365
Platform
  1. Windows
I get a slight displacement when 1st clicking the button, but it still works. That said, ActiveX buttons are notoriously flaky.
I'd recommend replacing it with a forms control button, or a shape.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,437
Messages
5,528,761
Members
409,834
Latest member
vexceled

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top