![]() |
Show progress of copying
Dear all,
I am using Excel 2003 SP2 and VB 6.3 I am trying to use Excel to copy from the server. for that I use "scripting.filesystemobject" to get the list of files. 'my code is.......... '********************** Function Copy_Data(ByVal fromFolder As String, ByVal toFolder As String) Dim FSO As Object Set FSO = CreateObject("scripting.filesystemobject") FSO.copyfolder fromFolder, toFolder End Function '********************** I need to show some kind of progress window. Since the folders are very big, it takes a lot of time to finish copying.. Is it possible to show any progress and if so how????? Thank you..... Reagrds Joe |
Show progress of copying
Joe,
It's not nearly as well documented but if you use the "Shell.Application" object rather than the "Scripting.FileSystemObject" to copy the folder, you will get the standard Windows Explorer show progress bar for copying or moving files and folders. Try something like: Sub CopyShowProgress() Const FOF_SIMPLEPROGRESS = &H100 Dim Shell, Folder toFldr = "C:\Temp" fromFldr = "C:\Test" Set Shell = CreateObject("Shell.Application") Set Folder = Shell.Namespace(fromFldr) Folder.CopyHere toFldr, FOF_SIMPLEPROGRESS Set Shell = Nothing End Sub Steve "Joe" wrote in message ... Dear all, I am using Excel 2003 SP2 and VB 6.3 I am trying to use Excel to copy from the server. for that I use "scripting.filesystemobject" to get the list of files. 'my code is.......... '********************** Function Copy_Data(ByVal fromFolder As String, ByVal toFolder As String) Dim FSO As Object Set FSO = CreateObject("scripting.filesystemobject") FSO.copyfolder fromFolder, toFolder End Function '********************** I need to show some kind of progress window. Since the folders are very big, it takes a lot of time to finish copying.. Is it possible to show any progress and if so how????? Thank you..... Reagrds Joe |
All times are GMT +1. The time now is 09:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com