How to Determine file size in bytes
Posted on August 22, 2011
1 2 3 4 5 6 7 8 9 10 | 'File/Folder Handling - How to Determine file size in bytes Public Function fnDetermineFileSizeInBytes(strFileName As String) As Long Dim intReadChan As Integer intReadChan = FreeFile Open strFileName For Input As intReadChan 'Can now refer to input file by this fnDetermineFileSizeInBytes = LOF(intReadChan) 'Gives us our filesize Debug.Print fnDetermineFileSizeInBytes & " Bytes" 'How can I call this function 'MsgBox fnDetermineFileSizeInBytes("C:\Temp\Project1.exe") End Function |