Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

progressbar as long as the file is being copied

Status
Not open for further replies.

miketamp

Technical User
Jan 28, 2005
20
GR
Hi
i have a form with a command button "bimport" which on click event copy a file to a specific path.the code for that is:

Private Sub bImport_Click()
fs.copyfile ([tbFile]), "c:\test\", True
DelayTime 4
If fs.FileExists("c:\test\" & [tbFileName]) = False Then
MsgBox "copy failed"
Else
MsgBox " copy is ok"
tbFile.Value = Null
tbFileName.Value = Null
End If
end sub

Public Function DelayTime(PauseTime As Double)
Dim start
'PauseTime = 4
start = Timer
Do While Timer < start + PauseTime
DoEvents
Loop

End Function

also on the form is a progressbar "ProgressBar9" and the form's name is "frm1".
everything works fine but i would like to programm the progressbar to run as long as the file is being copied
can anyone please help me? thanks...
 
To get the standard copyfile progressbar:
Dim objFolder As Object
Set objFolder = CreateObject("Shell.Application").NameSpace("c:\test")
objFolder.CopyHere [tbFile]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
hi
thanks for your reply
where exactly do i put that in my code? and how can i display a msgbox after the copy process is completed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top