|
-
May 1st, 2019, 04:34 PM
#1
file save completed
i have a file saved from an external program, i have to open and read, i need to know when the writing of that file is completed
previously i have been using a simple loop
Code:
Do While FileLen(myfile) = 0
DoEvents
l = l + 1
If l > 10000 Then MsgBox inv & " timed out": Exit Sub
Loop
this has been working for several years, but on a new, faster machine, the code continues before the file saving has completed, i can obviously extend the loop or use a sleep, but i would like some way to actually test, when the code should continue
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|