Clicking/activating ActiveX control locks excel cell - excel

I am encountering a small difficulty with an excel file I am working on. When moving from one sheet to another, the new activated sheet is sometimes locked in that sense that I can't make keyboard inputs. This seems to be the consequence of a interacting with a combobox or a listbox.
The issue also arises when I first click on the control and then try to change the content of the unlocked cell of the protected sheet. When the sheet is unprotected, the issue does not arise.
This seems to be resolved when I add this code on the control lostfocus event
debug.print selection.locked
Do ActiveX controls interfer with sheet protection or keyboard input (I can still use the dropdowns of those cell, select them with the mouse, etc.)
Any clue of how to resolve this without adding this mysterious line?
Thanks for your help!

If you have the formula bar hidden just turn it visible. I know it sounds wierd but it worked for me.

Related

Unable to scroll in one particular sheet only

One of the sheets in my workbook has been imported from another workbook. On this particular sheet, scrolling (with my mouse wheel) is somehow disabled. I can scroll just fine on all the other sheets.
Here are a few things I tried:
I went to the sheet properties, because I assumed there was something in the ScrollArea property that was causing this. But the ScrollArea property is blank.
There aren't any macros affecting the sheet, and in fact, the workbook is saved as an xlsx, not xlsm, so I don't think a macro is a potential culprit at all.
I went to "view" to see if this was due to a frozen pane, but there are no frozen panes.
I'm sure there's a simple explanation, but I'm stumped. Does anyone have any ideas about how this could be possible?
Thanks in advance for any help!

Changing the text of an Options Button on Excel for Mac 365

I have made a workbook on Excel for Windows and I am now trying to get it to work on Excel for Mac. (I have Office 365, so I have the most current versions of Excel on both computers.) For the most part it works fine, but there are a few things that aren't working. One bit that is really confusing me is changing the text of some Option Buttons that I have on a few different sheets. (Based on some input, the text of the Option Buttons needs to change.)
In Excel for Windows, here's how I change the text:
ThisWorkbook.Sheets("Sheet1").Shapes("OptionButton1").TextFrame.Characters.Text = "New Text"
The above works whether or not Sheet1 is the ActiveSheet, and whether or not OptionButton1 is in a column that is currently hidden.
That line of code does not work on Mac. For it to work, I have to split it up, and introduce a Select command. I also have to Activate the sheet.
With ThisWorkbook.Sheets("Sheet1")
.Activate
.Shapes.Range(Array("OptionButton1")).Select
Selection.Characters.Text = "New Text"
End With
It's annoying that after the code runs, one Option Button is selected on each page.
Another annoying thing -- I have to make sure the column that the Option Button is in is not hidden. I assume this is because I am being forced to select the Option Button itself, and it can’t do that if it’s in a hidden column?
I would love to NOT have to select the Option Button at all, but I can't figure out any other code to change the text. To be honest, the only reason I was able to come up with this code is because I recorded a macro of myself actually doing it.
If anyone knows about Excel for Mac and could help, please let me know. Thanks!
I would add ActiveSheet to the code to prevent all objects named Option Button 1 from being selected at the same time
ActiveSheet.Shapes.Range(Array("Option Button 1")).Select
Hiding columns does not affect option buttons' visible property on Mac or Windows. Option buttons have their own hidden/visible property.
Using this syntax works on both Mac and Windows, so why not go with it intstead of the older way?

activeX combo boxes

I have a complex workbook that has a number of ActiveX Combo boxes which I choose over form controls for their customization options. Inexplicably, ALL of the boxes stopped working this morning. Literally, one minute they worked and then stopped completely. I was not working on that sheet, but rather a different one. There is no code attached to the combo boxes. When in design mode, the properties box doesn't even come up. Developer>Properties opens the worksheet properties only. This problem is not associated with the workbook because older versions of the same sheet are acting the same way. However, the compiled version of the workbook works fine. This suggests corruption in Excel somehow, so I repaired Excel (Office 365). No difference.
I deleted the combo box and replaced it and it is ok now, but that's not good enough for me. I have many others to remove and replace, but why do I need to do this? There are 180 other boxes that this happened to in the past and I simply used Data Validation for because I could not have this happen. I distribute this workbook in a compiled version only, so if I was certain that this bizarre occurrence could not happened once its compiled, I will replace all of the boxes that don't work and replace all of the data validation boxes with activeX, and compile it immediately. But I like things to make sense. What the heck is going on?
An ActiveX combo box has it's code on the sheet module for the sheet it is in. So, it's not odd that looking for the properties of the combo box that the sheet module would pop up. When in design mode and you right click on the combo box a pop up menu should come up that allows you to click and see the box's code on the sheet module. Are you saying that all the code for the boxes vanished or you had never written it? How do they get populated? I apologize for commenting in the answer section but I don't have enough points yet to write in the comment section.
The fact that no one has answered this suggests that this is behavior that I am causing. My belief at this point is that there is code running in the background which suspends other activity. I have a pop up calendar that ends with a range selection. I believe that this is looping somehow.
I am going to replace the data validation boxes with more combo boxes throughout the sheet with the calendar code in mind.

Excel Listbox in a Sheet with FreezePanes

I have an Listbox Multiselect ActiveX control in a Sheet with Freeze Panes. The problem is that when I try to select items the mouseover icon is the standard excel cross instead of the arrow. I know that this question was asked before, but I didn't find any answer.
Thank u in advanced for help
I tested, and I came up with a few interesting observations.
In the ribbon, go to the developer tab. Make sure that the Design
Mode is not on.
When I first froze panes on the sheet, the freeze line went through the listbox I created. This caused the behavior you are describing with the cross-hairs and being unable to select.
Then I moved the listbox. Still same problem. I tried clicking on various cells around the sheet and in the ribbon area, with no change in behavior.
When I clicked to another sheet and back again, it started working as expected. Normal pointer mouse. I could select multiple, and unselect as needed.
Based on what I've tried, it seems that making sure Design Mode is off, and clicking to another sheet and back again may fix the problem.

Making use of selected or clicked cell without VBA

A tricky one, I assume. However, is there a way to make use of a selected or clicked cell in Excel somehow without the need for VBA?
(I know how to do it with VBA, but macros are macros, but if you want to give workbooks to people...)
For instance, I would like to make some of the content in the freezed section to be dependent on where in the sheet someone is. It would be optimal, if the selected cell/row would be trigger enough.
It would be also okay, if clicking a cell (e.g. a link navigating in the sheet) would trigger the conent to change. Hence, a solution would be to make a hyperlink change a value in some cell somewhere. I know, this is a different question, but it should be all accomplishing the same goal of the line on top ;-)
Thanks a lot!
You cannot change values or display of another cell with formula or functions.
The hyperlink will send you to another location but won't change the freezed part, except if you only freeze rows and the hyperlink send you to a further column. But you will have then to really think about your layout very precisely. Moreover, the user will even less understand what happens unless you can design a great UI (but Excel may not be the best tool though).
Some tips:
Use hyperlinks but on differents sheets
Use "transparent" macros (without big buttons but rather event vba as you pointed out)
Sorry i don't have a magical solution.

Resources