Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default don't understand whats wrong with this userform

I would like to display a 'waiting' / 'working' warning after clicking a
button on a userform. i know this can be done in several ways, but as the
userform was there anyway, i thought the easiest would just be to have a
text box ("Working - Please Wait...") to be made visible after clicking the
<OK button (the userform staying open until all actions completed).

the textbox is made invisible using [SaveForm1.Label8.Visible = False] when
the form is initialised; my problem is that i can't make it visible again
(except when i put [msgbox label8.caption] after [SaveForm1.Label8.Visible =
True]. how could i get this to work? The code is below.

Many thanks,

Tim


Private Sub CommandButton2_Click()

'SaveForm1.Label8.ZOrder (0) <-- the textbox is on top anyway - this didn't
make any difference
SaveForm1.Label8.Visible = True
Application.ScreenUpdating = True

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ActiveWorkbook.Path & "\site.ini", True)
a.WriteLine (ComboBox4.Text)
a.Close

Sheets("Parameters").Range("e3") = TextBox3.Text
ActiveWorkbook.SaveAs TextBox1.Text & TextBox3.Text



SaveForm1.Hide
Unload SaveForm1
MsgBox TextBox3.Text & " is Saved"

End Sub




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default don't understand whats wrong with this userform

Tim,

I am confused. You talk of a textbox as your message, but you make a label
visible.? Then you try and pick up text from a textbox in a MsgBox after you
have unloaded the form.

Can you give a step by step description of what you are trying to do, not
just the messagebox.

--

HTH

RP

"Tim" wrote in message
...
I would like to display a 'waiting' / 'working' warning after clicking a
button on a userform. i know this can be done in several ways, but as the
userform was there anyway, i thought the easiest would just be to have a
text box ("Working - Please Wait...") to be made visible after clicking

the
<OK button (the userform staying open until all actions completed).

the textbox is made invisible using [SaveForm1.Label8.Visible = False]

when
the form is initialised; my problem is that i can't make it visible again
(except when i put [msgbox label8.caption] after [SaveForm1.Label8.Visible

=
True]. how could i get this to work? The code is below.

Many thanks,

Tim


Private Sub CommandButton2_Click()

'SaveForm1.Label8.ZOrder (0) <-- the textbox is on top anyway - this

didn't
make any difference
SaveForm1.Label8.Visible = True
Application.ScreenUpdating = True

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ActiveWorkbook.Path & "\site.ini", True)
a.WriteLine (ComboBox4.Text)
a.Close

Sheets("Parameters").Range("e3") = TextBox3.Text
ActiveWorkbook.SaveAs TextBox1.Text & TextBox3.Text



SaveForm1.Hide
Unload SaveForm1
MsgBox TextBox3.Text & " is Saved"

End Sub






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default don't understand whats wrong with this userform

OK - apologies (i'll try to engage brain before typing this time!)

- the userform has various controls (comboboxes, textboxes, buttons etc)
over the top of some of these i have a label box (with the 'working...'
message as the caption).
- on initialisation of the userform the label box is made invisible
- the user works through the userform and eventually presses the command
button
- one of the first actions of the command button code should make the label
box visible before doing the other tasks
- the problem is that the label box does not become visible
- i put the msgbox [label8.caption] in as a way of 'suspending' the code,
upon displaying the message box, the label also appeared on the userform (is
it that the displaying of the message box is providing enough time to make
the label on the userform appear?). in the normal running of the code, i
wouldn't want the message box in the code)

I hope this is more descriptive! Thanks for your help,

Tim

"Bob Phillips" wrote in message
...
Tim,

I am confused. You talk of a textbox as your message, but you make a label
visible.? Then you try and pick up text from a textbox in a MsgBox after

you
have unloaded the form.

Can you give a step by step description of what you are trying to do, not
just the messagebox.

--

HTH

RP

"Tim" wrote in

message
...
I would like to display a 'waiting' / 'working' warning after clicking a
button on a userform. i know this can be done in several ways, but as

the
userform was there anyway, i thought the easiest would just be to have a
text box ("Working - Please Wait...") to be made visible after clicking

the
<OK button (the userform staying open until all actions completed).

the textbox is made invisible using [SaveForm1.Label8.Visible = False]

when
the form is initialised; my problem is that i can't make it visible

again
(except when i put [msgbox label8.caption] after

[SaveForm1.Label8.Visible
=
True]. how could i get this to work? The code is below.

Many thanks,

Tim


Private Sub CommandButton2_Click()

'SaveForm1.Label8.ZOrder (0) <-- the textbox is on top anyway - this

didn't
make any difference
SaveForm1.Label8.Visible = True
Application.ScreenUpdating = True

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ActiveWorkbook.Path & "\site.ini", True)
a.WriteLine (ComboBox4.Text)
a.Close

Sheets("Parameters").Range("e3") = TextBox3.Text
ActiveWorkbook.SaveAs TextBox1.Text & TextBox3.Text



SaveForm1.Hide
Unload SaveForm1
MsgBox TextBox3.Text & " is Saved"

End Sub








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default don't understand whats wrong with this userform

Tim,

If I put the MsgBox in before the form hide it works for me.

You don't need the hide and the unload. Hide removes the window, but keeps
the form in memory, Unload removes it from memory which also closes the
window.

--

HTH

RP

"Tim" wrote in message
...
I would like to display a 'waiting' / 'working' warning after clicking a
button on a userform. i know this can be done in several ways, but as the
userform was there anyway, i thought the easiest would just be to have a
text box ("Working - Please Wait...") to be made visible after clicking

the
<OK button (the userform staying open until all actions completed).

the textbox is made invisible using [SaveForm1.Label8.Visible = False]

when
the form is initialised; my problem is that i can't make it visible again
(except when i put [msgbox label8.caption] after [SaveForm1.Label8.Visible

=
True]. how could i get this to work? The code is below.

Many thanks,

Tim


Private Sub CommandButton2_Click()

'SaveForm1.Label8.ZOrder (0) <-- the textbox is on top anyway - this

didn't
make any difference
SaveForm1.Label8.Visible = True
Application.ScreenUpdating = True

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ActiveWorkbook.Path & "\site.ini", True)
a.WriteLine (ComboBox4.Text)
a.Close

Sheets("Parameters").Range("e3") = TextBox3.Text
ActiveWorkbook.SaveAs TextBox1.Text & TextBox3.Text



SaveForm1.Hide
Unload SaveForm1
MsgBox TextBox3.Text & " is Saved"

End Sub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default don't understand whats wrong with this userform

Bob, thanks for your help.

I managed to get it to work using: -

saveform1.repaint

regards,

tim

"Bob Phillips" wrote in message
...
Tim,

If I put the MsgBox in before the form hide it works for me.

You don't need the hide and the unload. Hide removes the window, but keeps
the form in memory, Unload removes it from memory which also closes the
window.

--

HTH

RP

"Tim" wrote in

message
...
I would like to display a 'waiting' / 'working' warning after clicking a
button on a userform. i know this can be done in several ways, but as

the
userform was there anyway, i thought the easiest would just be to have a
text box ("Working - Please Wait...") to be made visible after clicking

the
<OK button (the userform staying open until all actions completed).

the textbox is made invisible using [SaveForm1.Label8.Visible = False]

when
the form is initialised; my problem is that i can't make it visible

again
(except when i put [msgbox label8.caption] after

[SaveForm1.Label8.Visible
=
True]. how could i get this to work? The code is below.

Many thanks,

Tim


Private Sub CommandButton2_Click()

'SaveForm1.Label8.ZOrder (0) <-- the textbox is on top anyway - this

didn't
make any difference
SaveForm1.Label8.Visible = True
Application.ScreenUpdating = True

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(ActiveWorkbook.Path & "\site.ini", True)
a.WriteLine (ComboBox4.Text)
a.Close

Sheets("Parameters").Range("e3") = TextBox3.Text
ActiveWorkbook.SaveAs TextBox1.Text & TextBox3.Text



SaveForm1.Hide
Unload SaveForm1
MsgBox TextBox3.Text & " is Saved"

End Sub








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
whats wrong with this? brownti via OfficeKB.com Excel Discussion (Misc queries) 10 February 12th 07 02:39 PM
Whats wrong with this? LucasBuck Excel Discussion (Misc queries) 3 January 12th 06 08:15 PM
Whats Wrong with this?? drvortex Excel Worksheet Functions 1 October 30th 04 06:48 PM
Whats wrong? Lee Excel Programming 0 July 14th 04 05:04 PM
whats wrong with my array? joshashcraft Excel Programming 2 September 9th 03 07:54 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"