S
sweet_dreams
Hi all,
I have problem with userforms in Word.
I have a template in which I have such a macro:
Sub AutoNew()
Application.Visible = False
UserForm1.Show
Dim i As Integer
For i = 1 To 10000
' some code
Next i
Unload (UserForm1)
Application.Visible = True
End Sub
So everytime when I open new doc based on this template UserForm1 is
shown.
But unfortunately userform1 doesn't diasapear. When I try to close it
manualy I get error: "Can't load or unload this object."
So my question is how can I close programmaticaly Userform after some
code have been executed, like in my example.
Whats more I noticed that code in loop is executeg when I close this
UserForm.
What I would like to achieve is to perform some code when Word is not
visible. I need UserForm to show progess of this actions and show
information connected with what is done. But unfortunately I can't show
any code on Label which is placed on form beacuse code in loop is
executed when form is closed. Can somebode give me any clue how can I
achieve what I wanted.
Regards,
sweet_dreams
I have problem with userforms in Word.
I have a template in which I have such a macro:
Sub AutoNew()
Application.Visible = False
UserForm1.Show
Dim i As Integer
For i = 1 To 10000
' some code
Next i
Unload (UserForm1)
Application.Visible = True
End Sub
So everytime when I open new doc based on this template UserForm1 is
shown.
But unfortunately userform1 doesn't diasapear. When I try to close it
manualy I get error: "Can't load or unload this object."
So my question is how can I close programmaticaly Userform after some
code have been executed, like in my example.
Whats more I noticed that code in loop is executeg when I close this
UserForm.
What I would like to achieve is to perform some code when Word is not
visible. I need UserForm to show progess of this actions and show
information connected with what is done. But unfortunately I can't show
any code on Label which is placed on form beacuse code in loop is
executed when form is closed. Can somebode give me any clue how can I
achieve what I wanted.
Regards,
sweet_dreams