LOF(filenumber)

Returns the length or size of an open file, in bytes (Long).


filenumberThe number of the file (Integer).

REMARKS
* This function should be used for files opened with the Open statement.
* You can use the FILELEN function to obtain the size of a file that is not open.
* The equivalent .NET function is Microsoft.VisualBasic.FileSystem.LOF
* For the Microsoft documentation refer to docs.microsoft.com

Open "C:\temp\myfile.txt" For Input As #1 
Debug.Print LOF(1)
Close #1

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top