I've added several ActiveX "Option Button" Controls into an Excel 2013 cell, and have also added a basic Comment onto this same cell with some text. Via the default behavior, when a user mouses over this cell the Comment will be displayed.
The issue I'm facing is that the Comment is not displayed when the user mouses over the ActiveX Controls (but it works anywhere in the cell outside the ActiveX controls). Does anyone know a simple workaround to make a Comment's mouse-over behavior work for the entire cell, including when their hovering over the embedded ActiveX control? Thanks!
Related
Office 365/Excel, I did the following:
Open New blank workbook.worksheet
Insert activex textbox 3)properties - link to a cell (G1).
But when out of design mode and selecting the textbox to type, the cursor is not showing - that is, no invitation to type anything. If I type something in G1, that value appears in the textbox. If I type something in the textbox, the characters are invisible in the textbox but appear dynamically in G1, and then appear in the textbox when I click outside the textbox.
Also, if I format textbox to change the order to something else (say "bring to front"), I can type in the textbox OK, but when I click outside, the behaviour returns.
I read somewhere a textbox is bi-directional and this appears to be so, except for being unable to see the characters typed in the textbox.
Wondering if you're using external monitors?
There seems to be a bug in Excel and I had the exact same issue. As soon as I unplugged the second monitor or (actually just moving the Excel document to the main screen, the ActiveX textbox was working as intended).
Hope that helps.
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.
I've sought for a solution everywhere:
I've made a user program (in EXCEL) where the user shouldn't be able to change anything concerning the formatting (colour, width, fonts, comments ... etc. etc.): the user is only capable to see the tables in the (visible) sheets on the screen and the tabs "chooser".
The user can actively only edit in the cells. I use extensively sheet protection, shortcuts, scrollarea and my userdefined contextmenu to achieve what I want. With my +400kB VBAcode.
It works perfect in Excel 2007 (and I think for Excel 2010)!
For the ribbon to not appear I use:
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"", False)"
But not in Excel 2013! I use massively the [ALT]-key for my shortcuts, but when pressing it, the ribbons formatting options appear.
I've seen examples using:
CommandBars.ExecuteMso "HideRibbon"
But it is not a solution as it is always possible for the user get to the Autohide ribbon/Show Tabs/Show Tabs and Commands in the right upper corner.
Is there a way to get "rid" of the ribbon in Excel 2013 and by no means (except VBA) to get it back. Specially the [ALT]-stroke form the user shouldn't be able to call it.
EDIT
I've added an image showing a section of what it looks like having NO Quick Access Bar or Ribbon in my EXCEL 2007. There is only the MS titleline, a plein table and some tabs (sheets) to chose.
Some built in excel formulas and functions require you to select a range and they give you a gui control to do so.
How can incorporate one of these Range GUI controls into a VBA form to allow the user to select a range?
An example of this Select Range GUI control can be found on the Create New Formula Rule (for Conditional Formatting) below.
This is called a RefEdit control.
You may need to enable this by right-clicking the Controls Toolbox and selecting the option for "Additional Controls". Scroll down and check the box for RefEdit.Ctrl. This will add the icon to the Controls Toolbox (it is third from the right, in the second row in my screenshot).
You may also need to enable this from the References in the VBE:
These controls return an address string based on the range selected by the user.
NOTE This control does not seem to play well if the user form is shown vbModeless. If you don't know what that means, then you don't need to worry about it. A form's default behavior is to .Show vbModal, and it should work in that context. See also HERE for other potential pitfalls when using a RefEdit control.
Could someone please explain to me the difference between the combo box that's available via the Developer Ribbon in Excel 2007 vs. the Combo Box control that's in the VBA editor? I cannot get this simple line of code to work using the Developer combo box:
MsgBox Combo1.Value
I've tied it to the change event and it seems to be syntactically correct (I'm not a VBA coder by any stretch).
Is the Developer Ribbon version some bastardized craptastic Microsoft shortcut?
What I'm trying to do is populate a second combo box based on the selection of the first combo box. I'd rather not build a case statement for every possible selection. Is this possible using the Developer ribbon version?
You are talking about the Insert button on the Developer tab correct? From that button you can add an ActiveX control or Form control. You're better off using the form controls if your new to programming as they will behave more in line with any Excel VBA reading you've done and the help file. With the Form controls you can right click and choose 'View Code' and/or 'Rename Control and Code'. Renaming the control allows you to address it in VBA however you like. e.g. - Combo1.value or myFavoriteCombo.value
That being said, to answer your question directly, be sure you know the controls full name. If you used a form control and it was the first one you put on the sheet it will be named ComboBox1. To get to the combobox's properties you have to walk through it's 'parent' sheet.
i.e.
MsgBox Sheet1.ComboBox1.value (using the sheet's code name)
or
MsgBox Worksheets("SheetName").ComboBox1.value (using the sheets name as it appears on the Excel tab)