How to show a wait screen in VBA Excel 2010 -
i have macros running on workbooks , status screen shows progress user not have stare @ blank screen or loading screen of excel. or though. status page works, update macros run, excel not show of until after macros finish running. how show status screen?
status = "sheetname" private sub workbook_open() 'make sure screen active sheets(status).activate sheets(status).select end sub
if purpose of status screen give feedback while macros running, quick , easy alternative use status bar. here's sample:
sub yourmacro() dim statusold boolean, calcold xlcalculation ' capture initial settings statusold = application.displaystatusbar ' doing these speed code calcold = application.calculation application.calculation = xlcalculationmanual application.screenupdating = false application.enableevents = false on error goto eh ' code... ' every while code running application.statusbar = "something useful..." ' after code done cleanup: ' put things application.statusbar = false application.calculation = calcold application.displaystatusbar = statusold application.screenupdating = true application.enableevents = true exit sub eh: ' error handler... goto cleanup end sub
Comments
Post a Comment