Hi,
I've got this code which copies a file from one location to another. Would it be possible to include a progress bar to show how far its complete as the file is quite large.
The code is...
Many thanks,
I've got this code which copies a file from one location to another. Would it be possible to include a progress bar to show how far its complete as the file is quite large.
The code is...
Code:
Private Sub CommandButton1_Click()
If FileExists("C:\Archive.pst") Then
cpy_email.Caption = "Copying..."
CommandButton1.Caption = "Please wait"
CommandButton1.Enabled = False
CommandButton2.Enabled = False
Application.Wait Now + TimeValue("00:00:01")
On Error GoTo Err_FileInUse
FileCopy "C:\Archive.pst", "M:\email\Archive.pst"
Application.Wait Now + TimeValue("00:00:01")
cpy_email.Caption = "Done"
MsgBox "Done!", vbOKOnly, "Finished"
CommandButton2.Enabled = True
GoTo End_Sub:
Else
MsgBox "File not found!", vbOKOnly, "Error!"
End If
Err_FileInUse:
MsgBox "File is in use!", vbOKOnly, "Error"
CommandButton2.Enabled = True
CommandButton1.Enabled = True
CommandButton1.Caption = "Backup!"
End_Sub:
End Sub
Many thanks,