VBA editor auto-deletes spaces at the ends of lines

前端 未结 17 1304
不知归路
不知归路 2020-11-30 05:11

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?

相关标签:
17条回答
  • 2020-11-30 05:38

    In Excel 2010, toggling Design Mode button on the Developer Ribbon Tab solves the problem for me.

    0 讨论(0)
  • 2020-11-30 05:42

    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.

    0 讨论(0)
  • 2020-11-30 05:43

    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.

    0 讨论(0)
  • 2020-11-30 05:43

    I found this issue pops up when I had AutoSave on. Turning that off let me code without it compiling every second.

    0 讨论(0)
  • 2020-11-30 05:44

    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.

    0 讨论(0)
  • 2020-11-30 05:44

    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.

    0 讨论(0)
提交回复
热议问题