![]() |
Userform not displaying correctly
I have the following code in a module, it works fine when I step through the
code, but when run I end up with a Userform that is a white box on the screen. If I put say a Msgbox in so i can see it time this sub gets called the Userform is quite readable, what am I missing here? Sub PleaseWait(OnOff, PW_Message) ' This macro sets up the Please Wait Screen If OnOff = "ON" Then If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message ElseIf OnOff = "OFF" Then If PleaseWaitActive Then Unload PleaseWaitDisplay PleaseWaitActive = False Else End If End Sub -- Trefor |
Userform not displaying correctly
Hi Trefor,
Try inserting: PleaseWaitDisplay.Repaint after PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message --- Regards, Norman "Trefor" wrote in message ... I have the following code in a module, it works fine when I step through the code, but when run I end up with a Userform that is a white box on the screen. If I put say a Msgbox in so i can see it time this sub gets called the Userform is quite readable, what am I missing here? Sub PleaseWait(OnOff, PW_Message) ' This macro sets up the Please Wait Screen If OnOff = "ON" Then If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message ElseIf OnOff = "OFF" Then If PleaseWaitActive Then Unload PleaseWaitDisplay PleaseWaitActive = False Else End If End Sub -- Trefor |
Userform not displaying correctly
Your code works fine for me. My guess is that some other code in the UF code
module is causing the problem. I suggest commenting out all other code and then show it. If the problem disappears then incrementally uncomment the code and repeatedly show the UF until the problem starts again. This should isolate the offending code. Regards, Greg "Trefor" wrote: I have the following code in a module, it works fine when I step through the code, but when run I end up with a Userform that is a white box on the screen. If I put say a Msgbox in so i can see it time this sub gets called the Userform is quite readable, what am I missing here? Sub PleaseWait(OnOff, PW_Message) ' This macro sets up the Please Wait Screen If OnOff = "ON" Then If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message ElseIf OnOff = "OFF" Then If PleaseWaitActive Then Unload PleaseWaitDisplay PleaseWaitActive = False Else End If End Sub -- Trefor |
Userform not displaying correctly
Perfect, how simple was that. Many thanks.
-- Trefor "Norman Jones" wrote: Hi Trefor, Try inserting: PleaseWaitDisplay.Repaint after PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message --- Regards, Norman "Trefor" wrote in message ... I have the following code in a module, it works fine when I step through the code, but when run I end up with a Userform that is a white box on the screen. If I put say a Msgbox in so i can see it time this sub gets called the Userform is quite readable, what am I missing here? Sub PleaseWait(OnOff, PW_Message) ' This macro sets up the Please Wait Screen If OnOff = "ON" Then If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message ElseIf OnOff = "OFF" Then If PleaseWaitActive Then Unload PleaseWaitDisplay PleaseWaitActive = False Else End If End Sub -- Trefor |
Userform not displaying correctly
Greg, Thanks for the reply but Norman's reply got it.
-- Trefor "Greg Wilson" wrote: Your code works fine for me. My guess is that some other code in the UF code module is causing the problem. I suggest commenting out all other code and then show it. If the problem disappears then incrementally uncomment the code and repeatedly show the UF until the problem starts again. This should isolate the offending code. Regards, Greg "Trefor" wrote: I have the following code in a module, it works fine when I step through the code, but when run I end up with a Userform that is a white box on the screen. If I put say a Msgbox in so i can see it time this sub gets called the Userform is quite readable, what am I missing here? Sub PleaseWait(OnOff, PW_Message) ' This macro sets up the Please Wait Screen If OnOff = "ON" Then If Not PleaseWaitActive Then PleaseWaitDisplay.Show vbModeless PleaseWaitDisplay.PleaseWaitTextBox.Text = PW_Message ElseIf OnOff = "OFF" Then If PleaseWaitActive Then Unload PleaseWaitDisplay PleaseWaitActive = False Else End If End Sub -- Trefor |
All times are GMT +1. The time now is 05:30 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com