Excel ActiveX Button is clickable, but does not work - excel

About a week ago, I found that all ActiveX buttons stopped working in all spreadsheets, when running on my computer. They work on others just fine. There had been no issues for the past year.
I know there was recently a Windows updates that caused a stir, preventing people from even being able to click on ActiveX buttons. The issue I am experiencing seems to be different... I am able to click on the button (once clicked, it will show the dotted line around the perimeter of the button). however, nothing happens.
I have these buttons created to open User forms. I have checked to verify the PrivateSub code still exists to launch the form on the Button Click.
Since all my staff are still able to use the spreadsheets and ActiveX buttons, I am thinking there is something occurring locally on my computer, and it is not necessarily programming related, but I have had no luck finding any cause.
Any ideas?

I found a solution to the issue. It appears as though my issue WAS still related to the Microsoft update.. I just happened to be experiencing a different symptom, and needed a different solution as well (rather than just delete MSForms.exd files)
I recompiled the projects (Open VBEditor, Debug Menu, Compile VBA Project), saved workbook, closed excel, and re-opened. Everything worked as normal again.
Unfortunately, I need to do this for all files I work with which have ActiveX controls, which is several dozen.

Related

How to set up the correct 'View' for VBA Project in Microsoft Excel?

Not sure if this is the correct place to post this but this issue is driving me insane....
The Issue:
I have come to use my PC after the weekend and for some reason the layout of the VBA Project stuff is completely messed up...
Usually when my VBA is set up very nicely in what I believe is the standard viewing mode IE the Project box to the left and the code to right and the intermediate window at the bottom...
For some reason now I get the following:
As you can see it is just the code...
I then click on the project explorer window and the project details appear, but as one ridiculously large page....
Then I minimise the window and alter its shape to try and get it at least look like it used to...
I can live with this to an extent although everything is floating and annoying... But now, every time I click onto a module (to view the code). It opens each module as its own seperate window!
This as you can imagine is unsustainable when working with as lot of code and having to flick between different modules
What I have Tried:
I have tried looking in different settings and I can not see anything different...
I have restarted my PC and it is still the same...
I have tired opening a different spreadsheet and still the same....
Does anyone have any suggestions? I just want it to be back to the simple layout of everything joined together etc...

VBA editor in any Office 365 app not opening anymore

I am using VBA in most of my office 365 applications for many years now. Last week an error appeared that I can't fix anymore, without having to create a new profile in windows (according to Microsoft helpdesk). Besides that this is quiet a lot of work that I would like to avoid, if this is the only solution, I like to know what happened and why, to prevent future errors.
Problem: in any office 365 application, when opening the vba editor, in the taskbar, a window appears that I cannot open and that looks like a corrupted editor window. Hence I cannot edit my code anymore. The code is runnable though from the developers-macros-run-menu.
Cause: I ran a code from ms-word, that saves the pages from a merged document into separte files, .docx and .pdf. The code was running fine, but after a little editing started to quit before the last page was reached and after some time trying over, I couldn't open the editor anymore. I am not sure if this error is caused by the code, or something else.
Unfortunately I cannot display the code here, because I can't open it anymore.
I updated Office 365 to the last version, without any result.
Creating a new Windows-account solves the problem, but implies that I have to reinstall many apps and services.
Does anyone have had the same experience, what is the problem and/ or what can I do to restore this error other than the new-account solution?
The VBA Editor window moved off screen. This might have been caused by accidentally pressing WINDOWS KEY + SHIFT + ARROW (not likely), or by a problem in windows 10.
For a solution see https://superuser.com/q/53585
I'd the same problem.
That´s just a question of hidden windows. Just press shift and left click on top of the code window in the task bar. Then select maximze and your window will appear.
Hope it helps.
Joao

Treeview Control becomes unresponsive - Excel 2013 64 Bit

My Problem: Treeview Control 6.0 becomes unresponsive in Excel 2013 64 Bit (Compile Error: Method or Data Member Not Found). I am able to delete the control, insert a new Treeview and it initializes fine (loads Imagelist, allows user configuration of nodes, etc.); however, once I save/close/reopen it becomes unresponsive again. This Excel tool allows users to configure a dashboard using Treeview and it worked fine (still works fine) in Excel 2007. I can include the code to initialize the Treeview control, but it is not a code issue as it works perfectly in Excel 2007.
Attempted Solutions: I have read through many forums and have tried numerous solutions to fix, but none have fixed the issue...
Running a batch file (as Admin) to unregister/re-register MSCOMCTL.OCX in the correct location
Deleting all .exd files from my hard drive
Removing/adding Common Controls reference in VBA editor
Deleting/Recreating the Treeview numerous times
Repeating above solutions in every possible order
The strangest part to me is that I can re-create the Treeview (insert, set properties), run code to initialize, and completely configure the Treeview with no issues... it only becomes unresponsive after saving/closing/re-opening. Again, the opening/closing routines worked fine in Excel 2007 so I don't think it is a code issue.
Any help would be greatly appreciated... I need Treeview to work as it stores all of the user dashboard info (TV terminals, files to open/close, etc.).
I encountered the same problem with EXCEL 2016, 32 bit version. EXCEL does not recognize the embedded TREEVIEW control after saving and reopening the file. (Sometimes it would work on the first save and reopen, but fail on the second.) This problem did not occur with EXCEL 2010 and earlier, same spreadsheet. Like you, I can embed a new TREEVIEW control, name with the name the macro populating uses, i.e., the name originally given to the unresponsive TREEVIEW control. I did not have to delete the unresponsive control like you did because EXCEL did not recognize it. You can check this by going to Develop tab and activating the properties view.
Curiously, I found a couple of workarounds this bug in EXCEL:
When I saved the file while in Developer mode, it opened OK and the TREEVIEW control worked, but you have to run a macro to populate. So far it works, but who knows....
When I embedded the TREEVIEW control in a Form, rather than directly in the spreadsheet, it saved and reopened OK, at least so far. No need to be in Developer mode or rerun the populating macro.
Good luck, maybe one of these will work for you.

Excel 2007 Issue: Pre-programmed Buttons suddenly not working [duplicate]

This question already has answers here:
Microsoft Excel ActiveX Controls Disabled?
(11 answers)
Closed 8 years ago.
Today, out of the blue, a form that the company I work for uses, suddenly had an issue with it's buttons. Strangely enough it only is affecting what I'm pretty sure are the ActiveX Command Buttons and not causing a problem with the other shapes or drop downs.
The issue. The buttons are non-responsive. When you click, they don't access the code and checking them via the shapes menu and selecting "view code" causes them to open the developer menu, but not the code associated with them. The really big issue is that for some reason they ALL seem to have started failing at the same time. The version on the server no longer works (the primary copy), the copy the user uses (notorious for breaking things) and the version I use (which is on my local computer).
Is there a way to take them an re-associate them with the proper code, without deleting them completely re-making them or is there possibly someone who's had the same issue and figured out a fix?
I'd greatly appreciate any suggestions or help - please note: I'm 99.9% sure that the issue is not code based.
The problem is caused by a recent Office update. Here is the fix posted on http://excelmatters.com/2014/12/10/office-update-breaks-activex-controls/
To fix it, do this:
Close all Office applications.
Do a search in Windows Explorer – make
sure to include hidden and system files and folders – for *.exd files
(note: that’s not *.exe !!) and delete any you find.
Make sure you get these:
C:\users\username\AppData\Local\Temp\Excel8.0\MSForms.exd
C:\users\username\AppData\Local\Temp\VBE\MSForms.exd
Reboot the computer (this is not always necessary, but probably better safe than
sorry)
Restart your Office apps and test the controls again.

Enable button using VBA excel

I have an uncommon issue. I have an Excel file with macros. On all computers it was installed Office 2010 and everything worked fine, but a few days ago every computer was upgraded to Office 2013.
In code, at some point I enable or disable some buttons based on some criterias.
ThisWorkbook.Worksheets("Lab Orders").OLEObjects("CommandButton1").Enabled = False
On some computers this works fine , but on other computers this button is shown as enabled, and if the user clicks the button nothing happens, not even the animation where the the button is pressed, so it cannot execute the code behind. It's like an image. Any leads, or reasons why this is happening only on certain computers ?
I have this problem after the Office got upgraded. PS. All computers are in the same domain.
LATER EDIT
I changed the code line
ThisWorkbook.Worksheets("Lab Orders").CommandButton1.Enabled = True
and now I get this error: 438 at this row (I debbuged the file on a computer where this file does not work)
I suspect it's the issue with the latest Office updates - see if this fixes it: http://excelmatters.com/2014/12/10/office-update-breaks-activex-controls/
On all computers where you have the problem, check the box "Trust access to the VBA project object model" located in Options/Trust Center/Macro Settings
(Note that this will only apply to Excel, and if you are having the same problems on other MS Office softwares, you should do the same on them as well)
If that's still not working, read and apply all the checks on this page : https://support.office.com/en-gb/article/Enable-or-disable-macros-in-Office-files-12b036fd-d140-4e74-b45e-16fed1a7e5c6
Did not fit as a comment, so:
If I understand you correctly, some computers show the button enabled, while in fact it is disabled, right?
In this case it's normal no button press animation "visibly happens" as Windows knows the button was programmatically disabled.
The same thing happens if you hook a window (which has buttons on it) and send any button a WM to show itself as if it was enabled (while in fact it is not).
The reason it seems enabled on some computers may vary, most probably it's video card and/or driver 'issue', or some "strange alignment" (that particular OS with that particular graphics card & driver and DirectX, as well as those 'special' OLE settings, etc).In both cases, the screen area don't get "refreshed" (invalidated) after the button was disabled - so it seems enabled and gets "repainted" only when there was some user interaction around it. "Lazy redraw", so to speak :)
What one can do is, if it happens to be a serious issue, to find a way on one of these computers to get the button visibly disabled with some 'workaround' (e.g. changing button text after it was disabled -maybe even to exactly the same text-, or move it 1 pixel away and back, call InvalidateRect on it, etc), and apply that solution to your Excel macro.
UPDATE after reading asker's comment:
Oh I see. This could happen if the buttons are in a control array. The issue in this case, however should be present on all computers... Strange.
Anyway. Try to test the buttons' Index property to see if they are part of a control array, just to be sure. If yes:
a) remove them from the array and create buttons "independent" from each other
b) create a bool array and store there enabled/disabled status and write a function that updates buttons' text color property & handles button click event ignore/accept

Resources