Excel FileLen Function (VBA)
How to use the FileLen Function (VBA)
This Excel tutorial explains how to use the Excel FileLen function with syntax and examples using VBA.
The Excel VBA FileLen function returns the size of a file in bytes.
The file size can be returned in kilobytes, megabytes and other similar size units.
To get the size of a file in bytes.
The FileLen function returns a numeric value in bytes.
The FileLen function syntax has the following arguments:
- pathname: Required. The pathname argument is a string expression that specifies a file name.
- The pathname may include the directory or folder, and the drive.
- If the specified file is not available then an error will occur.
- To obtain the length of an open file, use the LOF function.