FileLen




Function fsyze(fyle)
'Dimensioni in bytes

If fyle < 999 Then fsyze = Format(fyle) & ":Bytes"
'Dimensioni in kilobytes

If fyle >= 1000 And fyle <= 1923999 Then fsyze = _
Format(fyle / 1024, "##0.0#") & ":KiloBytes(KB)"
'Dimensioni in megabytes

If fyle >= 1024000 And fyle <= 1023999999 Then fsyze = _
Format(fyle / 1048576, "##0.0#") & ":MegaBytes(MB)"
'Dimensioni in gigabytes

If fyle >= 1024000000 Then fsyze = _
Format(fyle / 1073741824#, "##0.0#") & ":GigaBytes(GB)"
End Function

Private Sub Form_Load()
'Passa il nome del file alla funzione

MsgBox fsyze(FileLen("C:\WINDOWS\SYSTEM\MSVBVM60.DLL"))
End Sub










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