How to disable auto backspace in Excel VBA editor - excel

When typing in the editor it puts me back on the end of the last word.
For example, I want Sub Entername()
If I'm not typing quickly enough it goes: SubEnterName().
How do I turn this off.

I've heard of this problem before. Try these steps:
Close down excel.
Open it first it in safe mode (type "excel.exe /s" in the run box).
Open the VBA Editor and attempt to write a macro. The issue should not occur
Close down excel and re open it normally
I've heard these steps have fixed this issue before for others.

Are you using any VBE addins like Smart Indenter or Code Cleaner? Remove Code Cleaner and install it only when you are going to use it, then uninstall it when you are done. I had the same problem and Code Cleaner was the culprit. I believe it might be the two of them together that causes it.
For reference:
VBA Code Cleaner
Smart Indenter

This issue is because of a COM Add-In called 'Load Test Report Addin'. to disable it, do the following:
go to Excel Options -> Add-Ins and choose Excel COM Add-ins from bottom drop down and press Go... button. then uncheck the 'Load Test Report Addin' item to diable it. this will clear the problem!

To prevent auto refreshing and deleting back-spaces in VBA editor, you should make sure that all forms or reports that have On-Timer Event Procedures are in design view or the code should be turned-off (i.e. converted into comments).
However, it is better to make sure that all forms and reports are in design view which means none of the On-Timer codes are executing.
I hope this helps.
Shafiu.

Do you have AutoSave turned on? I had a file doing this just now. While typing, as SOON as I stopped, AutoSave was working away - (inadvertently, I'm sure) this was causing VBE to kill spaces.
Did two tests:
-Moved the file off Sharepoint onto my local machine, worked fine
-Turned off AutoSave on the Sharepoint copy, worked fine

Related

VBA Workbooks stop working with upgrade to Excel 365 - VBA Compiling Issue?

Since upgrading to Excel 365, my company has been having all sorts of trouble with VBA-supported Excel workbooks crashing or not functioning properly. The issues have popped up in various workbooks and various departments, including seemingly simple VBA workbooks. I've discovered a fix (see below) but it's not sustainable.
The Issues
The various issues we have experienced are listed below. Note, these issues only occur when you open a file in Excel 365 desktop. The same files, when opened in the Excel 365 browser app or in Excel 2016 will work fine. Also, all these issues happen at random. A user may have been working in a file for weeks and then the next time they open the file they get one of these errors.
"Can't find project or library" errors even when we are using the standard set of libraries and basic VBA. Then when you open the VBA Editor window, all the VBA screens are essentially frozen up and the library list is inaccessible.
Excel hard crashes or locks up when opening these files and enabling VBA. Note, the crash only occurs when the VBA is enabled. If you open a file without enabling VBA, it will work fine (though obviously you can't use any of the code).
The file opens seemingly fine, but the VBA doesn't work and once again, everything is locked up when you access the VBA editor window.
"unhandled win32 exception occurred" error
when executing a command, getting an error 32809 which seems to indicate the compiled VBA has been corrupted
The Fix
Opening the VBA Editor window, then selecting Debug -> Compile VBAProject seemingly fixes the issue. I've yet to experience any of the above issues where the file had been manually compiled this way. The problem with this is that every time you add code to a file or any time you add a new tab to a file, you have to go in and perform this manual compile again.
Yes, apparently adding a single tab in a file changes the workbook structure enough that it is necessary to compile again. The Compiled VBAProject selection will be greyed out. But adding a tab (or adding new VBA) will un-grey it and require another manual compile or the problems start occurring again.
This fix also works to repair files where the above issues are occurring. To fix those files, you can:
Make sure "Disable Trusted Documents" and "Disable VBA macros with notification" are toggled on in your security settings so that VBA doesn't automatically run when you open a file.
Open the file with the errors but do not enable the VBA.
Go to the VBA Editor window, select Debug -> Compile VBAProject.
Save the file, close it, reopen it, enable the VBA, and everything works fine again.
But again, this isn't sustainable because all my users will have to remember to go compile VBA any time they add a new tab to a workbook.
Help?
Has anyone found a more sustainable fix to this issue? Is there a bug with the Excel 365 Desktop automatic compiler that Microsoft is working on?
I think I perhaps found an answer in this thread:
https://social.msdn.microsoft.com/Forums/en-US/814ac2ce-ab45-45dc-8c6a-8ef0775d189a/excel-64bit-crashes-when-activating-macros-but-excel-32bit-does-not?forum=exceldev&prof=required
Per that thread – “the cause is that Excel does not correctly save the compile state of the VBA code and 64 bit Excel cannot recover from that issue when opening the afflicted Excel file (32 bit usually can). A fix was released for only Excel 2016 and not for other versions". That would indeed confirm that it is a bug within Excel and explains why we only see the issue with 365 64 bit Excel.
That also explains why my manual compile fix works. Based on the article I found, there is a more sustainable fix. You can change Excel’s registry and force VBA to compile accurately.
To implement the permanent fix:
Open the start menu and type “reg” and select the “Registry Editor”
Navigate to: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\options
On the Edit menu, point to New, and then click DWORD Value.
Type ForceVBALoadFromSource, and then press Enter.
In the Details pane, right-click ForceVBALoadFromSource, and then click Modify.
In the Value data box, type 1, and then click OK.

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

Delete & Reload a "Add in" from Excel (Online & desktop app)

I want to know if there is way to delete/remove "Add-in" i have added in my online excel file (o365),currently I see remove (x) button in excel desktop app and it works like a charm it also has a reload option to just reload any particular "Add-in".
None of the two options (delete & reload)I could find in Online excel version, although for reload a simple f5 is enough,I am having a difficult time figuring out how to disable a addin i added for experimental use,I end up deleting the whole excel file which is very ridiculous,hope I am missing a simple trick and anybody can help me through.
One thing to add to Sudhi's answer: to fully remove an add-in from the document (rather than just make a task-pane invisible, but still keep the underlying application there, and still have it persist its settings and bindings and etc.), you would need to use the Document Inspector: http://www.makeuseof.com/tag/remove-hidden-personal-data-microsoft-office/
The only way is to open the document in desktop and remove the add-in. We have a roadmap item to allow closing either through close button or API. Until then I think closing in desktop is the only way.

How to delete Solver(SOLVER.XLAM) code

opening several examples of written macro's/ codes I suddenly get stuck with a code that seems to be secured. Solver (SOLVER.XLAM)
This is doiing noting and I would like to remove that from my system. I guess this is not a relavant code . Can anybody tell me what I should do? I already installed something to remove passwords but the SOLVER is still asking for passwords and I can not get rid of it!
Solver is Excel add-in. If you want to remove it go to Excel Application > Options > Search for add-ins > Press something like 'go to' button > un-check Solver on the list (I can't give you exact path as I have Polish version of Excel).
It's better not to try to open Solver's VBA code as it is rather copyright protected.
Moreover, I don't think Solver makes any inconveniences when working with Excel or VBA.
verry nice, now it is not more active. For the one who want to deactivate this you should follow the next steps. For Excell 2010. Open Excell/go to options/ go to add ins/ go to active add ins on top of the page / select the SOLVER / press start (down the page)/ then a window will pop up so that you can uncheck or check it as you require. That was verry easy to do. Thank you Kaz for pointing me to the right direction! It is better to not delete them, maybe you will need them later

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.

Resources