vba - How to stop Excel window from staying on top when macro is running continuously? Application.screenupdating doesn't work -
i'm trying run vba macro updates http response cell every second.
when macro running , switch program (chrome example), excel window (and along vba editor) pops , stays on top after couple of seconds.
i have seen other posts suggesting use of application.screenupdating = false
, doesn't work in case. i'm using mac if that's relevant.
for info i'm running 2 subs - first 1 http response string call second sub, , second sub uses application.ontime
calculate when execute first sub again.
i want macro run in background whilst work on other tasks.
update
seems application.ontime command stealing focus. tried run following sub test , replicated problem i've been having.
sub test() application.ontime + 0.01157407 / 1000, "test" '0.01157407/1000 = 1 second end sub
i'm not entirely sure how test issue i've never encountered it. , cannot comment on post suggestion. however, using following sub should disable of excel's updates, events , alerts.
do note make excel unusable user when enabled, , therefore needs disabled after calculations.
public sub fastapplication(optional byval opt boolean = true) application .calculation = iif(opt, xlcalculationmanual, xlcalculationautomatic) .displayalerts = not opt .displaystatusbar = not opt .enableanimations = not opt .enableevents = not opt .screenupdating = not opt end end sub
Comments
Post a Comment