tags:

views:

600

answers:

10

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?

A: 

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.

Lunatik
Oh, it does. I can't recall how I got that behavior un-stuck.
Smandoli
+1  A: 

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.

A. Scagnelli
And while you're there, you should check the `Require Variable Declaration` box. It will auto-enter an `Option Explicit` in every new file, saving you potential frustration when debugging a variable that *just won't change* since there's a typo in its name.
A. Scagnelli
+2  A: 

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.

Emily
A: 

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.

This answer sounds right to me, based on similar experience in Access. I can't remember what was causing code to twitch, but I was learning about recursion at the time ... shudder ...
Smandoli
A: 

Turn off Tools>Options>General > Background Compile. This solved it for me.

abhishek
A: 

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.

Jon Artus
+3  A: 

I had this exact problem and the following worked for me.

  1. Click the Microsoft Office Button, and then click Excel Options
  2. Click the Add-Ins category
  3. In the Manage box, click COM Add-ins, and then click Go.
  4. Look for an add in called 'Load Test Report AddIn' then uncheck it
  5. restart excel

This addin is installed with VS2010 Beta2

ade
This solution worked for me.
Jonathan Beerhalter
A: 

That last one solved the problem for me, thanks.

daniel
A: 

La suppression des blancs dans l'éditeur VBA pour Access se produit lorsqu'un formulaire est ouvert en mode Formulaire ("exécution"). Cela est sans doute dû à des éxécutions en arrière plan sur base de procédures "Sur Minuterie". Fermer le formulaire dans Access, résout le problème dans VBA.

Dom