Friday, May 04, 2007

Get the File Size

File Size - VBA Function

Sub Get_File_Size()

File1 = "c:\temp\Sample.txt"

MsgBox "The Size of the File is " & FileLen(File1) & " bytes"

End Sub

7 comments:

  1. Anonymous5:30 AM

    thank you

    ReplyDelete
  2. Anonymous5:09 AM

    Is there any way to get the file size when a file is greater than 4GB ?

    ReplyDelete
  3. Anonymous7:01 AM

    If your file is over 4GB I'd suggest that VBA and Excel is the wrong medium...

    ReplyDelete
  4. Anonymous9:29 AM

    Bad suggestion..

    They didn't say that they had an Excel File bigger than 4GB, just how do I check to see if A (any) file is over 4GB..

    smh

    ReplyDelete
  5. Anonymous2:07 PM

    agreed, very bad suggestion.

    ReplyDelete
  6. Anonymous10:19 AM

    If FileLen(FilePathFileName) > 4000000000 Then

    ReplyDelete
  7. Anonymous6:46 AM

    4*1024*1024*1024:)

    ReplyDelete

StumbleUpon
Share on Facebook

Visual Basic for Applications (VBA) Forum (recent threads)

CodeKeep VBA Feed

Visual Studio Tools for Office Forum (recent threads)

Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.

Office Business Applications (OBA) Team Blog

MSDN Code Gallery Published Resources For Tag VSTO

microsoft.public.vsnet.vstools.office Google Group