Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
how to check file is saved in VBA

operation. Please see my main sub for detail and download sub in main sub is no any isue
THe problem is when the file example, example.csv is opened in Excel by VBA, the example.csv file is
just part of the file only since download time is really long like 10 seconds. I want
to know what is good VBA method to check the file is completed download before any file open ?
I try to use DIR( ) that is not okay because it just check the file name is existed or not.
ANd I also try to use .saved in VBA but that return Run-time error. Please help to
advise
Duncan
"Run-time Error "
if workbooks(wkdir).saved= true then
workbooks.open filename= wkdir ReadOnly:=True
Else
debug.print "Dowload not completed"
Endif
Sub mian ()
Dim wkdir as string
call download()
wkdir ="C:example.csv"
if Dir(wkdir) <> "" then
workbooks.open filename= wkdir ReadOnly:=True
Else
debug.print "Download not completed"
Endif
8 means append to file. It needs to be there so the file isn't overwritten. The false means don't create the file is it doesn't exist. Basically, my function tries to open the CSV file to write to it. If it works, the file is free, otherwise it isn't. It doesn't actually write to the file in any way, its just a test.
8 means append to file. It needs to be there so the file isn't overwritten. The false means don't create the file is it doesn't exist. Basically, my function tries to open the CSV file to write to it. If it works, the file is free, otherwise it isn't. It doesn't actually write to the file in any way, its just a test.
8 means append to file. It needs to be there so the file isn't overwritten. The false means don't create the file is it doesn't exist. Basically, my function tries to open the CSV file to write to it. If it works, the file is free, otherwise it isn't. It doesn't actually write to the file in any way, its just a test.
8 means append to file. It needs to be there so the file isn't overwritten. The false means don't create the file is it doesn't exist. Basically, my function tries to open the CSV file to write to it. If it works, the file is free, otherwise it isn't. It doesn't actually write to the file in any way, its just a test.
8 means append to file. It needs to be there so the file isn't overwritten. The false means don't create the file is it doesn't exist. Basically, my function tries to open the CSV file to write to it. If it works, the file is free, otherwise it isn't. It doesn't actually write to the file in any way, its just a test.
8 means append to file. It needs to be there so the file isn't overwritten. The false means don't create the file is it doesn't exist. Basically, my function tries to open the CSV file to write to it. If it works, the file is free, otherwise it isn't. It doesn't actually write to the file in any way, its just a test.