Vba File Copy Progress Bar

Posted on by

Atheros Ar9271 Wireless Driver Windows 8. Code: Private Sub CommandButton1_Click() If FileExists('C: Archive. Diy Layout Creator. 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 SubMany thanks. The problem is that the program is just to copy a file. I actually hide excel when the file is opened so that just a form with two buttons is displayed. Copy and Exit. When I click copy it just freezes until the files copied. I just wanted something to come up and display that it was doing something and give an idea of how longs its going to take. Cheers Yoko, when you say 'freezes' does it do this using the code I gave?

Vba File Copy Progress Bar

It shouldn't freeze using the above code, it should display the Windows copy dialog. What OS are you using? Code: Option Explicit Public Sub Workbook_Open() Dim mypath As Variant Dim newpath As Variant Dim newpath2 As Variant Dim mypath2 As Variant Dim objshell As Object Dim objfolder As Object mypath = Application.ActiveWorkbook.Path newpath = Windows.Application.DefaultFilePath newpath2 = Left(newpath, 3) & 'SLTS Exttract Database' mypath2 = mypath & ' SLTS Extract Database' Set objshell = CreateObject('Shell.Application') Set objfolder = objshell.NameSpace(mypath2) objfolder.CopyHere newpath2, &H0& Set objshell = Nothing Set objfolder = Nothing MsgBox 'The rest of my code is running now!!'

Is there a command in excel vba that copies files using windows default copy handler (which would give users a progress bar. Show progress meter when copying files. Dec 07, 2010 Experts Exchange >Articles >A VBA Progress Bar for Excel and Other Microsoft Apps. A VBA Progress Bar. Zip and unzip files and folders with VBA.