Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FSO CopyFolder  in VB 6 -- how to know when it's finished?

Posted on 2004-04-28
2
Medium Priority
?
1,086 Views
Last Modified: 2012-05-04
Please could an expert suggest the best way to detect in VB6 when FSO CopyFolder has finished copying.

When the folder has much content the process can take enough time to permit an unintended user intervention.

Will be appreciated

Gordon
0
Comment
Question by:Gordon_Atherley
2 Comments
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 375 total points
ID: 10945117
In my experience FSO.CopyFolder is finished when it moves on to the next command.  Consider this code sample:

    Dim fso As New FileSystemObject
    Label1.Caption = "Running"
    DoEvents
    fso.CopyFolder "C:\Source", "C:\Destination\", True
    DoEvents
    Label1.Caption = "Finished"

When I run this the label stays at running until the CopyFolder process is actually finished and moves on to change the label to "Finished".  
0
 
LVL 3

Accepted Solution

by:
Level10Access earned 375 total points
ID: 10945407
Using FSO, the script will only move to the next line after the copyfolder process is either completed or errored out.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question