excel active x control button is not working suddenly [duplicate] - excel

This question already has answers here:
Microsoft Excel ActiveX Controls Disabled?
(11 answers)
Closed 8 years ago.
I'm working with excel macro-enabled files,
Today I just found out the button i made was not working-cannot be click- which was working yesterday.
And digging up the matter,
I found out that other Activce X controls is not working also, and I cannot event insert Activce X controls.
when i try to insert Activce X controls (just normal basic button)
excel give me "Cannot insert object" message box.
And It's same with my colleague's computer.
Is only us having this problem today?
and was there had any MS-updates related to this issue yesterday?

https://social.technet.microsoft.com/Forums/office/en-US/94d0b004-3303-421d-9ed2-351683b89d08/sudden-problems-with-inserting-activex-basic-controls-such-as-command-buttons?forum=officeitproprevious
found out the solution.
Quit Excel.
Start Windows Explorer.
Select the system drive (usually C:).
Use the Search box to search for *.exd
Delete all found files.
(Thanks to Excel MVP RoryA for this tip)
Regards, Hans Vogelaar (http://www.eileenslounge.com)

The same thing happened to me today. Not only could I not insert the activex object, but the one I had used for a number of years would not work. Apparently both answers are correct. Microsoft advised to find and delete the *.exd files or use the fix-it tool under for symptom 1 in their Office Configuration Analyzer Tool 1.2 (which I downloaded). I used the fix-it tool, which worked.
So the credit must go to Stackoverflow.
Thanks

I was not able to find .exd files in C:\, but used Microsoft Office Configuration Analyzer Tool 1.2 and fixed it. When you run the tool for Excel, you will see critical, warning and informational. One of the warning shows or relates the symptom like "Cannot insert object" error in an ActiveX custom Office solution after you install the MS14-082 security update. I used the "Fix It" button under Resolution for symptom 1. It worked.

Related

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

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.

VBA editor auto-deletes spaces at the ends of lines

Is there a way to convince the VBA editor in Excel to stop auto-formatting lines to remove the space at the end when I pause in my typing for a quarter second?
I had this exact problem and the following worked for me.
Click the Microsoft Office Button, and then click Excel Options
Click the Add-Ins category
In the Manage box, click COM Add-ins, and then click Go.
Look for an add in called 'Load Test Report AddIn' then uncheck it
restart excel
This addin is installed with VS2010 Beta2
In Excel 2010, toggling Design Mode button on the Developer Ribbon Tab solves the problem for me.
I've definitely had that issue before, where the vba editor would format as I was typing (not just when I went to another line). For me, it seemed to be related to a Microsoft Web Browser control that I had in an open workbook. When I took out the web browser, the VBA editor started acting normally again. I have no idea why that worked, but it did. Now I avoid using that control in my workbooks.
Something is causing your spreadsheet to recalculate while you are in the VBA Editor and this 'compiles' your code and thus strips the spaces. You need to stop the cells recalculating while you are editing. Turning the calculation to manual in the spreadsheet.
Tools > Options > Calculation should do the trick.
I noticed this when I had cells recalculating thanks to a DDE connection.
There is sort of a way to turn off the auto-"correction" in the VBA Editor.
Tools Menu -> Options -> Editor Tab -> Clear the Auto Syntax Check box
Sadly, this won't solve all your problems, as the VBA Editor tends to have a mind of its own, for better or worse.
Taking it out of design mode fixes it every-time on vba2003 - its was driving me crazy at first ... i did notice it might have something to do with the web control but when i take it out of design mode it works fine ... just toggle that to get it to behave :)
I have had this same problem several times recently, and has driven me crazy.
After reading this post all the different fix-ups mentioned (none worked for me), I recalled I have been playing lately with Internet Explorer Control, opening Internet Explorer from VBA.
This is mentioned in some of the answers in this post.
This got me in the right path and, in order to fix it, I had to first delete all iexplore.exe instances (alt+control+delete), closed Excel and open excel again.
(iexplore.exe had been opened invisible from the VBA code, and I didn't know they were running)
That fixed the bug.
I have been programming quite heavily with VBA for over 4 years, and never had this problem.
Just a couple of weeks ago I started using IE control, and I started getting this problem...so in my case I can only assume the bug is directly related to the IE control.
I am running both excel 2003 and 2007 in same PC at the same time, and the problem only happens with excel 2007.
None of the above for me.
I had a Application.OnTime timer that fired every second and this triggered a recalculation of something: commenting it made my day.
This has started happening to me recently after adding a Timer event to an Access 2007 form. The VB editor "finalizes" the current line (as if you had moved the cursor off of the statement; I have auto syntax checking off) each time the event fires (initially I had it set to 1 second, now it is set to 5 seconds, and the behavior scales accordingly). In order for the event code to execute, the application has to ensure that it has been compiled. Presumably, the editor needs to be in a "sane" state to do this, as it probably has to check for code dependencies among modules. Note that the behavior occurs regardless of whether any dependent code is actually loaded into the editor at the time. Note also that resetting the execution state doesn't affect the timer event firing. As a practical matter, one could close the triggering form, switch it to design view, set a breakpoint in the triggered code, or increase the timer interval while working with the editor.
In contrast to abhishek's comment, changing the settings of Tools/Options.../General/Compile On Demand and/or Background Compile did not affect the issue.
If it helps, none of the previous answers solved mine. Only solution appeared to be to close the xls file and reopen it. Frustrating to have to do every 30 mins but at least it works. Would love to know why it's recompiling and cleaning the text... should really be an option to disable the text cleanup but couldn't find it.
Turn off Tools > Options > General > Background Compile. This solved it for me.
This is a long standing problem that could have various causes. I had this same issue occur in the Access VBE (so naturally the Excel answers weren't relevant). After a LOT of digging I finally got it fixed with the solution below. First a recap though:
If you are here because of this issue in Excel, try the solutions above first. To summarize:
The most common issue in Excel is that the Design button is toggled. Toggle that and see if the behavior changes as submitted by Dmitry Frenkel above
If that doesn't work, check for the "Load Test Report" AddIn as mentioned by Ade.
Those are really the two main causes in Excel, but if neither of those solutions work, then scroll through the rest of the solutions here. All are valid possibilities for the cause. In Access the cause is pretty straight forward. It's a timer issue on a form somewhere. I found this solution from here by User Kevin K. Sullivan.
Copy the following line of code onto the clipboard. (You might need to
paste it into a text editor first and coerce it onto one line, depending on
your newsreader. It must be one line.)
For i = 0 to Forms.Count -1: Debug.Print Forms(i).Name, Forms(i).TimerInterval: Next i
Switch to Access.
Press Ctrl-G to go to the Immediate Window.
Press Ctrl-V to paste in the code.
Press enter to to run the code. All open forms will be listed. Any non-zero timer intervals are your culprits. Simply close that form (It may be invisibly open from another process than the one you thought you were dealing with).
I think the solution for Access here is what the user Dom was trying to say above. I guess the down votes were because it wasn't explained very well and/or because he was speaking of Access when the OG issue was in Excel. Regardless, he is likely on point if you are here because of the VBE in Access.
I hope this helps people. I know I kept finding this page when researching this issue, so that's why I thought I'd update this solution here.
I hit this problem today on a fresh install of Excel 2010 Beta 2. None of the above made any difference, but going into the trust center and disabling all application add-ins fixed the problem for me.
I have Office 2010 Pro and I had the same issue. As I type the space between each word was being deleted. After trying each of the options turning them on and off the only way I found working was to disable the Winzip Courie(excel) add-in. This is done thru the Options dialog box Add-Ins section.
In office 365 I had the same issue - what worked for me is I saved the file with a different name and when I re-opened the new file the problem went away.
I found this issue pops up when I had AutoSave on. Turning that off let me code without it compiling every second.
I don't think I've ever seen the VBE remove a space when I've stopped typing. It will remove trailling spaces from lines if you move to another line, but that's something different and not behaviour that I think can be altered.
The removal of spaces in the VBA editor for Access occurs when a form is open in Form("Execute") mode. This is probably due to background executions based on "On Timer" methods. Close the form in Access solves the problem in VBA.

How do I get rid of the "cannot empty the clipboard" error? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Right now, I'm getting it in Excel 2007, but I've gotten the same error in pretty much every version of Excel I've used since 97. The only discernable similarity is that happens on my office PC. It's never bothered me on my home PC.
In Excel 2003, I was able to mess around in the clipboard options until it went away. In 2007, though, the options seem to be seriously limited and generally useless. Google wasn't much help, either.
check this tip. worked for here
http://mobeer.blogspot.com/2009/01/excel-2007-cannot-empty-clipboard.html:
This might save somebody some time and headaches if google picks it
up. I was getting a 'Cannot empty the Clipboard' error every time I
moved cells around in Excel - eventually I mucked around with the
settings and made it go away. Here's how; In the excel main menu
(glass globe w/logo), click Excel options, then Advanced, then turn
off 'Show paste options buttons'
How exciting was this as my first post of the year?
Update: I still haven't found a permanent solution but I found another
thing that seems to help. In Excel 2007, from the "home" tab, the
first thing on the left is the clipboard tool panel. Expand the panel
to view the clipboard and in the clipboard you might find "cannot
empty clipboard" as an entry. Empty the clipboard, keep the panel open
for a second or two while you do a few cut and pastes/drags etc. and
then the bogey seems to go away.
I call this the cable dance because back in the day I had a printer
that only worked if you unplugged the cable, shook it out and plugged
it back in.
Good answers by Paul Simon and Steve Homer, I shut down team viewer and that did the trick.
Skype or other programs may trigger the same glitch, but in this instance, I recalled the problem occurred when I tried to cut n paste a 2MB file from remote system through windows right click rather than using "File Transfer function in TV. An error message appeared, then the problem with Excel "'Cannot empty clipboard' message.
This problem occurs when you are working on a remote system. After copying and pasting a huge amount of data it shows the error. I have found the solution to this problem.
Go to remote systems task manager and perform the following task
Go to Task Manager > Processes
Look for "rdpclip.exe"
End that process
Your problem will be solved.
I found this advice:
There are a few steps to solve your
problem:
First thing to do is Clear items from
the Office Clipboard. If the Microsoft
Office Clipboard is not displayed in
the task pane, click Office Clipboard
on the Edit menu. On the Office
Clipboard task pane, do one of the
following: To clear all items, click
Clear All .
Next thing is to switch off the
clipboard show option. To do this,
what you can do is to again display
the Clipboard menu (select Office
Clipboard from Edit Menu). And in the
selection button "Options" at the
bottom of the screen, select this
particular option: "Collect Without
Showing Office Clipboard"
and now, you are relieved of the bug.
Hope this helps.
here. I have the problem, but it's sporadic. I just tried the technique, and I don't see the problem, but since it's sporadic I won't know for a while if it's gone for good.
I got rid of the problem by unchecking the option for "Alert before overwriting cells" in Excel options. I'm using Excel 2007
If you can't find the clipboard, then close that excel sheet and reopen it again. This will solve your problem.
Try http://support.microsoft.com/kb/207438
which will work for 2007 if you follow v12.0 in the registry.
Are you running Skype? This has been the best solution I have found to get rid of the "cannot empty the clipboard error" in Excel 2007 & 2010. Delete the Skype add-on in IE and/or Firefox and good-bye annoying error!
In reply to rjacobs7 post on February 28, 2011
Cannot clear clipboard error - Windows 7, Excel 2010 -
This error occurs nearly every time a drag and drop of cell contents is attempted. I've had this same error over the past 10 years on older computers and older versions of Windows and Office. It has now reoccurred with a new laptop running Windows 7 64 bit and Office 2010. The issue can be replicated only if a browser - IE or Firefox - is open at the same time that Excel is open. Having Word and/or Outlook open at the same time will not cause the problem to occur unless a browser is also open. This error is extremely irritating and no solutions from Microsoft or other posts on this issue resolve it.
I have a solution - at least for me! Delete the Skype add-in in IE and Firefox and the "cannot clear clipboard" error after a drag and drop goes away when IE and/or Firefox are running. Apparently some sort of memory-management issue with Skype, Office and the browsers.
I've read lots of blogs on this subject going back to 2005!!
I'm sure that Paul Simon is right (see his submission to this thread) and it's a question of finding which program on your machine is locking the clipboard. I do not run the programs listed in various solutons suggested (eg on Microsoft website) nor am I in a networked or virtual environment so for me those aren't the locking programs (but might be for you). Similarly I don't have the RDP task going in my processes. For me the locking program is the Skype Add-in.
I am not a sophisticated user and am scared of altering my registry so didn't want to go there.
I have now been able to reproduce accurately the "cannot clear the clipboard" message by turning on and off the skype addins in internet explorer. This is easy for amateurs to do and might be one of the more common clipboard locking programs:
I first confirmed that I can turn on/off the problem in Excel by opening/closing internet explorer.
Then I disabled the skype addins:
Internet Explorer: Tools menu --> Internet Options ; Programs Tab ; Manage Add-ons button; Toolbars and Extensions selected in panel on left - scroll down to find skype add ons. Press Disable button.
NB have to restart Internet explorer before this works.
.... 4 days later.... it's still working
I copied a picture (instead of text) that I had in my excel 2007 file and that solved the problem for me. The picture copied to the (then empty) clipboard. I could then copy cells normally even after clearing the clipboard of the picture. I think a graph object should also do the trick.
I have seen various answers which say when I uninstalled this or that it worked. I think that the uninstall is probably just sorting out an issue in the registry, rather it being an issue with the particular application that is being uninstalled.
I have also seen cases of people saying kill the RDP task but I don't have that and I still have the error.
I have seen cases of people saying clear the clipboard in Excel, but that doesn't work for me - nor does changing the settings in the Clipboard.
I believe that the issue is that an application has a lock on the clipboard and that application is not releasing it. The clipboard is a shared resource, so that implies that each application has to get a lock on it before changing it and then release the lock once it has completed the change, however, it looks like sometimes the lock is not released.
I found that the following cured it. Close down all MS applications including IE and Outlook. Check Task Manager processes to make sure that they are all gone.
Then restart the application where you had the Copy and Paste issue and it will probably then work.
Regards
Paul Simon

"Can't find Project or Library" for standard VBA functions

So I'm having to run someone else's excel app on my PC, and I'm getting "Can't find Project or Library" on standard functions such as date, format, hex, mid, etc.
Some research indicates that if I prefix these functions with "VBA." as in "VBA.Date" then it'll work fine.
Webpages suggest it has to do with my project references on my system, whereas they must be ok on the developer's system. I'm going to be dealing with this for some time from others, and will be distributing these applications to many others, so I need to understand what's wrong with my excel setup that I need to fix, or what needs to be changed in the xls file so that it'll run on a variety of systems. I'd like to avoid making everyone use "VBA." as an explicit reference, but if there's no ideal solution I suppose that's what we'll have to do.
How do I make "VBA." implicit in my project properties/references/etc?
-Adam
I have seen errors on standard functions if there was a reference to a totally different library missing.
In the VBA editor launch the Compile command from the menu and then check the References dialog to see if there is anything missing and if so try to add these libraries.
In general it seems to be good practice to compile the complete VBA code and then saving the document before distribution.
I had the same problem. This worked for me:
In VB go to Tools » References
Uncheck the library "Crystal Analysis Common Controls 1.0". Or any library.
Just leave these 5 references:
Visual Basic For Applications (This is the library that defines the VBA language.)
Microsoft Excel Object Library (This defines all of the elements of Excel.)
OLE Automation (This specifies the types for linking and embedding documents and for automation of other applications and the "plumbing" of the COM system that Excel uses to communicate with the outside world.)
Microsoft Office (This defines things that are common to all Office programs such as Command Bars and Command Bar controls.)
Microsoft Forms 2.0 This is required if you are using a User Form. This library defines things like the user form and the controls that you can place on a form.
Then Save.
I have experienced this exact problem and found, on the users machine, one of the libraries I depended on was marked as "MISSING" in the references dialog. In that case it was some office font library that was available in my version of Office 2007, but not on the client desktop.
The error you get is a complete red herring (as pointed out by divo).
Fortunately I wasn't using anything from the library, so I was able to remove it from the XLA references entirely. I guess, an extension of divo' suggested best practice would be for testing to check the XLA on all the target Office versions (not a bad idea in any case).
In my case, it was that the function was AMBIGUOUS as it was defined in the VBA library (present in my references), and also in the Microsoft Office Object Library (also present). I removed the Microsoft Office Object Library, and voila! No need to use the VBA. prefix.
In my case, I could not even open "References" in the Visual Basic window. I even tried reinstalling Office 365 and that didn't work. Finally, I tried disabling macros in the "Trust Center" settings. When I restarted Excel, I got the warning message that macros were disabled, and when I clicked on "enable" I no longer got the error message.
Later I re-enabled all macros in the "Trust Center" settings, and the error message didn't show up!
Hey, if nothing else works for you, try the above; it worked for me! :)
Update:
The issue returned, and this is how I "fixed" it the second time:
I opened my workbook in Excel online (Office 365, in the browser, which doesn't support macros anyway), saved it with a new file name (still using .xlsm file extension), and reopened in the desktop software. It worked.
Even when all references are fine the prefix problem causes compile errors.
What about creating a find and replace sub for all 'built-in VBA functions' in all modules,
like this:
replace text in code module
e.g. "= Date" will be replaced with "= VBA.Date".
e.g. " Date(" will be replaced with " VBA.Date(" .
(excluding "dim t As Date" or "mydate")
All vba functions for find and replace are written here :
vba functions list
For those of you who haven't found any of the other answers work for you.
Try this:
Close out of the file, email it to yourself or if you're at work, paste it from the network drive to your desktop, anything to get it to open in "protected mode".
Now open the file
DON'T CLICK ANY ENABLE EDITING OR THE YELLOW RIBBON
Go to the VBA Editor
Go to Debug - - Compile VBA Project, if "Compile VBA Project" is greyed out, then you may need to click the yellow ribbon one time to enable the content, but DO NOT enable macros.
After you click Compile, save, close out of the file. Reopen it, enable everything and it should be OK. This has worked for me 100% of the time.
In my case I was checking work done on my office computer (with Visio installed) at home (no Visio). Even though VBA appeared to be getting hung up on simple default functions, the problem was that I had references to the Visio libraries still active.
I found references to an AVAYA/CMS programme file? Totally random, this was in MS Access, nothing to do with AVAYA. I do have AVAYA on my PC, and others don't, so this explains why it worked on my machine and not others - but not how Access got linked to AVAYA. Anyway - I just unchecked the reference and that seems to have fixed the problem
I've had this error on and off for around two years in a several XLSM files (which is most annoying as when it occurs there is nothing wrong with the file! - I suspect orphaned Excel processes are part of the problem)
The most efficient solution I had found has been to use Python with oletools
https://github.com/decalage2/oletools/wiki/Install and extract the VBA code all the modules and save in a text file.
Then I simply rename the file to zip file (backup just in case!), open up this zip file and delete the xl/vbaProject.bin file. Rename back to XLSX and should be good to go.
Copy in the saved VBA code (which will need cleaning of line breaks, comments and other stuff. Will also need to add in missing libraries.
This has saved me when other methods haven't.
YMMV.

Resources