FileLen function

Category: File / I-O & Environment

Summary

File length in bytes.

Syntax

FileLen(pathname) The required pathname argument is a string expression that specifies a file. The pathname may include the directory or folder, and the drive.

Example

Example
This example uses the FileLen function to return the length of a file in bytes. For purposes of this example, assume that TESTFILE is a file containing some data.
Dim MySize
MySize = FileLen("TESTFILE") ' Returns file length (bytes).

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/filelen-function

Back to Functions