SizeFile




Dim nFileNum As Integer
Dim lFileSize As Long
'Get a new file number

nFileNum = FreeFile
'Open the file

Open "C:\SOMEFILE.TXT" For Input As nFileNum
'Get the Length

lFileSize = LOF(nFileNum)
'Close the file

Close nFileNum
' If you don't have the file open you can use the FileLen function.

Dim lFileSize As Long
lFileSize = FileLen("C:\SOMEFILE.TXT")
You can get the size of a file two ways.
If you have the file open you can use the LOF function.










( sizefile.html )- by Paolo Puglisi - Modifica del 17/12/2023