msgbox to NOT display OK Button and to run while saving?

  • Thread starter Thread starter Corey
  • Start date Start date
C

Corey

With the code below i want to see if i can have the file SAVING WHILE the
msgbox is being displayed, not
to START Saving once the KK button is clicked.

Is this possible??

Code(Part of):
res = MsgBox("Saving file this file may take a few Seconds, Please
wait....", , "Msgbox Title")
ActiveWorkbook.Save ' <========== Want this to occur DURING the msgbox being
Displayed, AND no OK Button on the MsgBox.
Application.Quit
End Sub

regards

Corey....
 
Hi Corey
I think the message box is designed to wait for a response. Two other
ways to do what you want:
1. Create a simple userform, which comes on like a splash screen then
can be removed when you want.

2. Write your message in the status bar across the bottom of the screen.

HTH

Andrew Bourke
 
Hello Corey,

The MsgBox is modal (locks out Excel until it is finished). The signal
to the system togive control back to Excel is when you click a button.
The MsgBox displays "OK" as the default.

You can achieve your goal by creating a UserForm instead. The form will
remain until you close it from your code routine. If you are concerned
that a user might click the Close Box on the form and interrupt your
save, you can disable it using a few API calls. I have the code to do
this if you need it.
 
UserForm2.Show
ActiveWorkbook.Save
UserForm2.Hide

Thanks for the reply.

I placed a userform in the code to state the file is saving.
No buttons on it.
But how do i get it to save while it is displayed, it currently only saves
if i click the X.

Corey....
 
Corey said:
UserForm2.Show
ActiveWorkbook.Save
UserForm2.Hide

Thanks for the reply.

I placed a userform in the code to state the file is saving.
No buttons on it.
But how do i get it to save while it is displayed, it currently only saves
if i click the X.

I put a code which do this a few weeks ago.
 
Corey,
That was just to indicate that I was not sure it would solve you problem.
It's not code. Delete it.

NickHK
 
Corey,

Do the Save from within the userform code, when it is activated say, not in
the main code.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top