View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Returning FileLen with very large file

Option Explicit
Sub testme()
Dim myFileName As String
Dim FSO As Object

Set FSO = CreateObject("Scripting.FileSystemObject")
myFileName = "C:\My Documents\giganticfilename.here")

MsgBox Format(FSO.GetFile(myFileName).Size, "#,##0")

End Sub

simonc wrote:

FileLen returns a Long integer but I have a file which is over 7GB in size,
which is beyond the limit of a long integer so I get an overflow error. I
need to extract the file length to calculate details of the contents of the
file. How can I do this?

Grateful for assistance.


--

Dave Peterson