PDA

View Full Version : [SOLVED:] ComboBox Function Lost



paulcrsm
06-08-2020, 06:00 PM
This is something that i don't understand. This code has been working for years, but now for some reason, it won't. There are a simple couple of comboBoxes (ComboBox1 and ComboBox2). Now when I try to run, I get a compile error because these are not recognized. If I go into the spreadsheet where the combo boxes are, and right click on them, I do not get a properties option like before, but now Excel thinks that these are pictures. The name box still says ComboBox1, but there is nothing in the value box. On a similar working file it says =EMBED("Forms.ComoBox1",""). I tried typing this in, but that didn't work. I also tried assigning macros and even deleting and re-inserting the boxes. Nothing seems to work. I can compare this bad file to similar files used in different areas that function just fine. There is no difference in the code. Any ideas?

Paul_Hossler
06-08-2020, 06:28 PM
Clean up the workbook with the problem and attach it here

paulcrsm
06-08-2020, 08:17 PM
Clean up the workbook with the problem and attach it here

I attempted to upload, but I got an error message from VBA Express stating that upload attempt failed (3 times). It may be because the file is over 5 Mbytes.

Paul_Hossler
06-08-2020, 08:32 PM
I'd say so

Delete everything that is not needed to show the issue and try again

paulcrsm
06-08-2020, 09:39 PM
I'd say so

Delete everything that is not needed to show the issue and try again



I deleted everything except for the page with the combo boxes and the code for reading them. They are on Sheet2 (Charts).

The VBA password is abc123. If you step through the subs ComboBox1_Change(), you will see that it doesn't recognize ComboBox1.Value as an object. Everything else is stripped out, so nothing else works. If I can get it to read ComboBox1.Value even in a watch, then this would be a success.

snb
06-09-2020, 03:43 AM
Don't post files with any kind of 'protection'.


Sub M_snb()
MsgBox Sheet2.OLEObjects.Count
MsgBox Sheet2.DropDowns.Count
End Sub

Your file doesn't contain any ActiveX-controls, nor formfieldcontrols.
It only contains 4 pictures ( .copypicture) of a combobox or dropdown.

Paul_Hossler
06-09-2020, 06:14 AM
I deleted and then re-added the ComboBoxes


I can't compile since the subs are not there, but I get a different message and the comboboxes seem to work like comboboxes should

26806