Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Returning FileLen with very large file

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel 2007 file in 2003 creates very large file Jon Pearce Excel Discussion (Misc queries) 2 July 16th 09 07:20 PM
INDEX/MATCH/LARGE returning #VALUE! error LucyRB Excel Worksheet Functions 9 June 1st 07 10:57 PM
Large Function returning top values J Shrimps, Jr. Excel Worksheet Functions 8 March 31st 06 04:02 AM
FileLen with very large files simonc Excel Programming 1 November 8th 05 01:07 AM
Returning a value if data is in a large list ChrisRad Excel Discussion (Misc queries) 2 June 21st 05 06:55 PM


All times are GMT +1. The time now is 09:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"