Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I put the filesize of a file in a variable?

Status
Not open for further replies.

BaDi

Programmer
May 14, 2002
32
0
0
NL
Hi!

How can I put the filesize of a file into a variable?

Thanx in advance!
 
Use FSO (File System Object - reference to Microsoft Scripting), to get the file size, and set the return value to a variable.

Dim oFso As New Scripting.FileSystemObject
Dim f As Scripting.File

Set f = oFso.GetFile("C:\myFile")

Debug.Print f.Size
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top