Wednesday, April 6, 2011

ScreenUpdating property and Excel/Word/Outlook Add-In

Recently while developing an Excel Add-In we faced a peculiar problem of Excel worksheet hanging after completing the processing. No problem in functionality, no memory leaks, no exceptions and nothing... We were breaking our heads where else it could fail...

After a couple of trials, we figured out that Workbook.ActiveWorksheet.ScreenUpdating was set to FALSE and was not turned back to TRUE. We usually set ScreenUpdating to FALSE to speed up the macro processing, but if we forget to turn back to TRUE; thats it; you will think Excel is hanging or something happened.. So please watch out while using ScreenUpdating in your code :)