file size

R

Rudy W.

Thanks Elwin, Deville and Cheryl,

Every answer gave a posible good solution.
In the meantime I found an other one:

The compress program moves the .xls file.
So testing if the .xls file was is gone seems a very easy
solution:

varExcelName = Dir(cExportPath & varFileName & ".xls",
vbDirectory)
Do While varExcelName <> ""
varExcelName = Dir(cExportPath & varFileName & ".xls",
vbDirectory)
Loop

Rudy W.
 
D

Douglas J. Steele

I don't understand why you have the vbDirectory in there if you're looking
for a file, not a directory. I'd suggest adding a DoEvents in there.
Finally, a real trivial point: it's more efficient to check that the length
of the string is 0 rather than compare it to a constant ""

varExcelName = Dir(cExportPath & varFileName & ".xls")
Do While Len(varExcelName) > 0
varExcelName = Dir(cExportPath & varFileName & ".xls")
DoEvents
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top