Second action button displaying in excel VBA, but I cannot select it - excel

I'm new to using VB w/ excel, so please forgive my lack of technical verbiage.
I recently received a new laptop, and transfered an excel file from my old laptop with VB setup to automatically generate reports. On the new laptop, when I click on my Active X Command Buttons, a smaller duplicate button appears. For some of these buttons, I can double click and the needed action is performed if that second button is under my mouse icon. For others (see picture), this second button displays, but when I move my mouse to get to it, it disappears.
Any help in resolving this would be greatly appreciated.

Try to select one button and use 'Tab' Key to select next one

Related

get button to appear no matter how far you scroll down excel sheet

In my excel document I want the button to appear no matter how far I scroll down. I don't know if there is a way to pin the button so that when I scroll down the button still appears. I dont want to scroll up all the way up to click the button. I added a photo if that makes things clearer.
I would suggest creating a custom tab on the ribbon with the macro you want to run. Unfortunately, there is not a way to pin a button in place, unless you use a userform per Tim Williams suggestion. I created a custom ribbon tab to get around this hassle.

Trying to ID a CommandButton on an Excel 2010 VBA application

I've just started a new contract and am working with Office VBA again after about 20 years. There is a spreadsheet I'm working on where command buttons disappear after the document saves. I've been reading other threads that suggest as a fix setting the size of the button after saving. However, I can't figure out how to identify that button in code.
When I click "Format", there is no place where the name of the object appears. There's a macro attached to it, but I see no way to identify the "sender" when the macro fires.
The macro pops up a form, and after the user enters some information and submits, it saves the sheet, and the button goes "poof".
Is there any way to get the name of the button in the macro so I can resize it?
Thanks!
If you right-click the button, its name appears in the upper left hand corner of the spreadsheet in the Developer ribbon, right below the "Visual Basic" and "Macros" menu items. In my case, it was "Button 1".
Accessing it was non-intuitive for a guy used to working with full-blown .NET apps, but the button is a "Shape". So, addressing the button is accomplished with the identifier ActiveSheet.Shapes("Button 1"). With this object, you can access its properties and methods.

Excel Active-X button cannot be clicked

I have a button that should be clickable in excel. When I try to click it, nothing happens. I have noticed that if I click and hold the mouse in the lower right hand corner, a second button appears. This has happened in the past, and when I moved the mouse to click that button, I could click and everything would work.
But this time, when I move the mouse, the button goes away. Thus, I cannot make the program work.
Anyone know what could be going on?
UPDATE: I tried to do this with a form control button, but I get the error that the macro is too complex. I have also tried several other active-x controls and they all do the same thing - label, checkbox, dropdown list, etc... Any help with the active-x controls would be greatly appreciated.
I found a solution to the issue. It appears that if you have the excel file open on an additional monitor (I have 3 screens: main + 2 additional), the button gives this quirky behavior. However, if you are the main screen, it works just fine.
I tried this on multiple computers and it was the same on all.
Not sure why that works, but it does for me.
I found that ActiveX command buttons only worked with the first window of a given workbook. I have multiple windows of the same workbook open in the same instance of Excel. ActiveX command buttons worked only with filename.xlsb - 1. ActiveX buttons were inoperable for the workbook's other windows, e.g., filename.xlsb - 2, filename.xlsb - 3, etc. This was irrespective of which monitor had the first window.
If somebody knows how to fix this, I'm all ears. For now, I am converting all my buttons to form controls, which always work fine.

Disappearing Excel buttons

I am seeing buttons disappear throughout Office programs - does anyone know why this may be happening? The first screenshot below is the VBE window when it first opens - if I drag a toolbar to a new location, all of its icons appear, but as soon as the mouse hovers over a button, the image disappears (though the button can still be clicked).
Other times when I open the VBE window, though, all of the buttons display correctly and do not disappear when the mouse cursor moves over them (not sure why this happens sometimes).
The other place I have noticed buttons disappearing is in the popup dialogs that appear when you copy/paste, for example. The buttons and drop-down choices exhibit the same behavior - some images are gone from the start (i.e. the initial pop-up button) and some disappear when the mouse moves over them (the dropdown choice buttons).
I also have this problem quite frequently. My research turned up things like "print = true in the properties" (which I usually don't want), "take focus on click", etc. etc. The only thing I've found that works 100% for me (whether right, wrong or indifferent) is to do the following with each button.
Private Sub CommandButton10_Click()
'__SEARCH FOR SOMETHING BY NAME__
With Me.CommandButton10
.Left = 860.5
.Top = 47.25
.Width = 50.25
.Height = 25.5
End With
'The rest of your code goes here..
End Sub
I know it's a pain to do it this way, and every time you click a button it
resets itself to the position, but I haven't lost a button since I started doing this. Now I do every button I use like this. I too would accept a "proper" fix if someone could come up with one. Hope this helps a little.
I am using an excel 2003 file but running it in excel 2007. I have an issue where suddenly ALL the macro buttons (about 25) disappeared on one of the tabs in my spreadsheet. Macros in the other tabs are not affected. The macros disappear only from the one tab. After several years of having to restore from a master file and update the data, I tried moving the macros (and changing the size slightly) that were on line 1 of the sheet (there are also macros further down the sheet and in different rows) so that they no longer touched the bottom of line 1 and have not had an issue now for 2 weeks. (The issue was happening every day the file was used). I think I suddenly stumbled upon a cure, but time will tell.
I am using excel 2003 on Windows 7. On my laptop left side USB drive G:/ needs something in the root section or all of my Buttons and checkboxes disappear. This happens to all routines written in the last 10 years.
Excel is installed on the C: drive and all files are run and saved there.
My removable drive letters got switch around and so my buttons disappeared when touched and then all of them. I manually set the drive letter of the USB drive back to G:\ and everything appeared as normal with just a few days of panic. A new USB stick in G: will also cause the problem, so whatever is in the root of the old stick I copy over to the new stick. Have not figured out what excel is looking for on the G: drive that causes the images to not show up. I have been to this forum hoping to find an answer over the years so hope this works for someone else.

VBA checkbox (2 times to check)

I'm working with VBA in Excel 2007.
When I click on my checkbox, I have to do it 2 times before the check mark appears. I have no idea what can cause that. Can somebody help me?
This behaviour is normal when the Excel application is not the active one on your screen (= doesn't have the focus)
the first click is to activate the Excel application window
the second click is to work inside the application.
This applies to Form or ActiveX checkboxes embedded a sheet, it even happens when you want to select a certain cell (say C2) ... when Excel was inactive, the first click (into C3) activates the application and shows the cursor at its previous location (say B3), second click will move cursor to C3.
User forms behave a bit different. Even when they have no focus at first, once you click into a checkbox inside the user form, it activates AND processes the checkbox - except if you trick it out by an event trigger (there are a few that could come in here)

Resources