Function File Operations Class

SizeFile

Return the size in bytes (characters) of a file. Returns Null if the file name is Null. Returns -1 in case of errors.

Signature (Visual Basic / VBA)

Public Function SizeFile( _
    ByVal vFileName As Variant _
    ) As Variant

Code Example

    StringToFile("This.", "Temp.Tmp") = True
    SizeFile("Temp.Tmp") = 5
    SizeFile("Temp.Two") = -1

Parameters

Parameter Description
vFileName Name of the file whose size is to be returned. Function returns Null if vFileName is Null or cannot be fixed-up to a String. Function returns -1 if vFileName does not exist or there is some other error determining its size.