Progress bar during workbook save

C

Craig

Hi there... I have hidden Excel(application.visible=False) and running
strickly from Userforms... on my userform is a Save commandbutton. I would
like to show a progressbar during the save procedure. This is the code that
runs when I click the Save Button. "Application.ThisWorkBook.Save". Is it
possible to make the progressbar work at the same progress as the workbook
save duration?

Thanks Craig
 
L

Leith Ross

Hello Craig,

Since you don't control the save process, it is impossible to kno
which block of n blocks total has been saved. You might want to displa
a animation instead. This at least let's the user know the computer i
processing and not hung up (not entirely true I know). Just
suggestion.

Sincerely,
Leith Ros
 
T

Tom Ogilvy

Just to add, whether you knew how many "blocks" have been saved or not, Save
is a single command and you would not be able to get control back to update
your progress bar (until the command is completed). At that point, the need
has passed.
 
C

Craig

The size of the file is allways about the same... is it possible to use a
progressbar that takes 20 seconds to run while the workbook is saving? This
would be fairly close to the time needed.
 
T

Tom Ogilvy

You don't seem to understand that a progress bar does not run. You have to
have code within your code that progresses the bar. (A progress bar is no
more sophisticated than a text box.) You can't do that for a single
command.
 
C

Craig

OK... I understand now... instead could I display a messagebox / Userform
with the message "Saving File...Please Wait!"
which would show before the file save and dissapear after the file save?


Craig
 
T

Tom Ogilvy

If using xl2000 or later

Sub AABB()
UserForm1.Show vbModeless
DoEvents
ActiveWorkbook.Save
Unload UserForm1

End Sub
 

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

Top