PDA

View Full Version : Size of Files



kamalmalek
10-08-2018, 12:44 AM
Dear Supporters,

i did small task in macro "not VBA" to create 10 excel files by name (1.xls 2.xls etc....)
now in VBA i treat those files (1.xls 2.xls etc....)
problem some files are duplicated in sizes
i need formula to do in VBA without open those files!
if same size of 1.xls or 2.xls or 3 .xls etc..... then msgbox "check extraction files"
else
call task()
end if

Thank you.

werafa
10-15-2018, 06:13 PM
Hi your actual question is rather unclear, but some thoughts for you are:

what can you get out of
Set myObject = Application.FileDialog(msoFileDialogOpen)
?

I've used this to specify a file without opening it as per
With myObject
.Title = "Choose File"
.InitialFileName = myPath & "\"
.AllowMultiSelect = False
If .Show <> -1 Then
MsgBox ("No File Selected")
Exit Sub
End If
fileSelected = .SelectedItems(1)
End With