i'm trying change text displayed in status bar in excel 2015 using vba. however, doesn't seem updated. message "ready" remains there.
function teststatusbar(delay long) dim progress long progress = 1 delay application.statusbar = "progress: test ongoing ...." & (progress / delay) & "%" doevents next progress application.statusbar = false end function
i tried many answers given here on website similar questions, nothing worked. wrong code or have change settings?
your function works fine, suspect calling udf excel cell. udfs not permitted update status bar, or make other changes excel environment. (basically, udf allowed return value , that's it.)
if called function piece of vba code, works ok, providing change return value such as:
function teststatusbar(delay long) string dim progress long progress = 1 delay application.statusbar = "progress: test ongoing ...." & (progress / delay) & "%" doevents next progress application.statusbar = false teststatusbar = "finished" end function
(you call other vba code saying myreturnvalue = teststatusbar(200000)
or change sub instead of function, i.e.
sub teststatusbar(delay long) dim progress long progress = 1 delay application.statusbar = "progress: test ongoing ...." & (progress / delay) & "%" doevents next progress application.statusbar = false end sub
(and call saying teststatusbar 200000
.)
Comments
Post a Comment