ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   execution subs not in logical order ? (https://www.excelbanter.com/excel-programming/344025-execution-subs-not-logical-order.html)

Pierre via OfficeKB.com[_2_]

execution subs not in logical order ?
 
Hi experts,

I have this simple code when the user click a button on a multipage userform;

Private Sub but_bereken_alles_Click()
lbl_momentje.Visible = True
maxstaffelbepaling
budget_neutraal_berekenen_franchise
nieuwe_eb_vullen
MultiPage1.Value = 3
lbl_momentje.Visible = False
End Sub

It should have the label lbl_momentje appear when the button is clicked
because all the sub that have to be calculated take about 6-7 seconds to
complete.
However, it first does the sub 'maxstaffelbepaling' and then it shows the
label.

Does anyone of you have a solution please ? I want to show the label first
and then execute the subs..
Thanks,
Pierre


--
Message posted via http://www.officekb.com

Rody Meulman[_3_]

execution subs not in logical order ?
 
Try DoEvents after making the label visible.

Met vriendelijke groet,

Rody


"Pierre via OfficeKB.com" <u13950@uwe schreef in bericht
news:567a21d2d1c2d@uwe...
Hi experts,

I have this simple code when the user click a button on a multipage
userform;

Private Sub but_bereken_alles_Click()
lbl_momentje.Visible = True
maxstaffelbepaling
budget_neutraal_berekenen_franchise
nieuwe_eb_vullen
MultiPage1.Value = 3
lbl_momentje.Visible = False
End Sub

It should have the label lbl_momentje appear when the button is clicked
because all the sub that have to be calculated take about 6-7 seconds to
complete.
However, it first does the sub 'maxstaffelbepaling' and then it shows the
label.

Does anyone of you have a solution please ? I want to show the label first
and then execute the subs..
Thanks,
Pierre


--
Message posted via http://www.officekb.com




Pierre via OfficeKB.com[_2_]

execution subs not in logical order ?
 
Thanks Rody,
This works wonderfully !
Pierre

Rody Meulman wrote:
Try DoEvents after making the label visible.

Met vriendelijke groet,

Rody

Hi experts,

[quoted text clipped - 20 lines]
Thanks,
Pierre



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com