Think of a file copy operation. As the files are copied, you see the progress bar to see how many files remain. You can either create your own form to display.
VB Guru's (I am not one) please help!I have a script that copies files one at at time by name from various locations using the FileSystemObject.copyfile method. I need to display a dialog or progress bar of some kind for the user to let them know the copy progress. The timing doesn't have to be accurate just some kind of feedback to the user that the script is running and something is happening. Someof these files are 1GB + and users are restarting the script before it is complete thinking that nothing is happening. I have found lots of code that will do this with folders and wild cards. I am reading a file name so I have the exact file name and I don't want to copy all the contents of the source folder. Here is some test code I've been working with. The problem here is that when I specify the entire source file name the copy doesn't work. If I specify a wild card extension or file name the script runs fine. Please help!
fnCopyHereVB
![Create vba progress bar Create vba progress bar](http://www.codeproject.com/KB/WCF/WCF_FileTransfer_Progress/WCF_FileTransfer_Progress.png)
Function fnCopyHereVB()
dim objShell
dim objFolder
set objShell = CreateObject('shell.application')
set objFolder = objShell.NameSpace('C:ScriptsCopyDest')
if not objFolder is Nothing then
objFolder.CopyHere('C:ScriptsCopySourcecopytest.*')
end If
Set objShell = Nothing
Set objFolder = Nothing
end Function
Thanks,
Jason
Hi All,
I just successfully completed a VA macro that does some file manipulation after copying it from a network to the C: of the user. It works beautifully except for one small problem.
The file seems to be a big one (something like 28 MB). So, it takes a long time. I was wondering of using a progress bar while the file is being copied.
I know the concept of progress bars and how to use it. But i cant figure out the logic of how to display the progress bar when the file is being copied.
Can someone please help me out!
Thanks in advance!
Lonely
I just successfully completed a VA macro that does some file manipulation after copying it from a network to the C: of the user. It works beautifully except for one small problem.
The file seems to be a big one (something like 28 MB). So, it takes a long time. I was wondering of using a progress bar while the file is being copied.
I know the concept of progress bars and how to use it. But i cant figure out the logic of how to display the progress bar when the file is being copied.
Can someone please help me out!
Thanks in advance!
Lonely