rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.92k stars 302 forks source link

Slow down excel very much when switch over 2 excel documents! #5901

Open tyysoft opened 2 years ago

tyysoft commented 2 years ago

Rubberduck version information

Version 2.5.2.6027 OS: Microsoft Windows NT 10.0.19042.0, x64 Host Product: Microsoft Office 2016 x64 Host Version: 16.0.4266.1001 Host Executable: EXCEL.EXE

Description When switch two excel files , it will slow down very much!

To Reproduce

  1. Open a excel file with macros , the macros are about 1000 lines, 10 procedures,
  2. press Alt + F11 open VBE,
  3. Select menu Rubberduck -> Refresh
  4. Go back to Excel window and press Ctrl+N create a new excel document
  5. Press Alt+Tab switch over the two excel document and click cells when the new window is popup
  6. You will find it will be take long time than before, and the cells will freeze when you click.

Expected behavior

  1. not slow down excel, not freeze when click cells
  2. if wish 1 is hard, then give users a check box to enable/disable rubberduck manually is another choice not too bad.

Screenshots N/A

Logfile

RubberduckLog - 11-19.zip Additional context N/A

MDoerner commented 2 years ago

I think what you are experiencing is Rubberduck reparsing and running the inspections after it detects that a new project has been added. (In Excel, all workbooks share the same VBE instance.)

Does the slow down persist after Rubberduck has finished?

To shorten the time the reparse takes, you can deactivate running the inspections after every parse in the settings. In contrast to the actual parsing, these do not take into account which components have changed, yet. In addition, if you want to deactivate Rubberduck, you can unload it in the VBE's addin menu and reload it there later.