Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi I am trying to show the file size in a form, I have got a form that
collects file names and creation date modified date but I also want to show the file size of each file found. can any body help to get the info above I am using API functions but I can't find anything about file size. TIA Frank |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Frank.
Dim FLen as long Flen = FileLen(ActiveWorkbook.FullName) --- Regards, Norman "Frank" wrote in message ... Hi I am trying to show the file size in a form, I have got a form that collects file names and creation date modified date but I also want to show the file size of each file found. can any body help to get the info above I am using API functions but I can't find anything about file size. TIA Frank |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks but it wont just be workbooks listed the form list all files in a
directory and puts the info into an access dB so I need to get file size for each file found. Thanks anyway. "Frank" wrote: Hi I am trying to show the file size in a form, I have got a form that collects file names and creation date modified date but I also want to show the file size of each file found. can any body help to get the info above I am using API functions but I can't find anything about file size. TIA Frank |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Frank,
Here is a simple function to get fileinfo Function FileInfo(path As String, Optional info As String = "Created") Dim FSO As Object Dim oFile As Object Dim i As Long Set FSO = CreateObject("Scripting.FileSystemObject") Set oFile = FSO.GetFile(path) Select Case LCase(info) Case "accessed": FileInfo = oFile.DateLastAccessed Case "modified": FileInfo = oFile.DateLastModified Case "created": FileInfo = oFile.DateCreated Case "path": FileInfo = oFile.path Case "size": FileInfo = oFile.Size End Select End Function call it like so fileinfo("C:\myTest\volker1.xls","Size") -- HTH RP (remove nothere from the email address if mailing direct) "Frank" wrote in message ... Thanks but it wont just be workbooks listed the form list all files in a directory and puts the info into an access dB so I need to get file size for each file found. Thanks anyway. "Frank" wrote: Hi I am trying to show the file size in a form, I have got a form that collects file names and creation date modified date but I also want to show the file size of each file found. can any body help to get the info above I am using API functions but I can't find anything about file size. TIA Frank |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
http://msdn.microsoft.com/library/de...e_data_str.asp
nFileSizeHigh High-order DWORD of the file size. This member has no meaning for directories. nFileSizeLow Low-order DWORD of the file size. This member has no meaning for directories. Usage is with the API function GetFileAttributesEx -- Regards, Tom Ogilvy "Frank" wrote in message ... Hi I am trying to show the file size in a form, I have got a form that collects file names and creation date modified date but I also want to show the file size of each file found. can any body help to get the info above I am using API functions but I can't find anything about file size. TIA Frank |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File Size With Macros Has Increased From Its Origina Size | Excel Discussion (Misc queries) | |||
Unusual File Size in Excel file | Excel Discussion (Misc queries) | |||
how to set sheet size to reduce file size | Excel Discussion (Misc queries) | |||
Unable to open excel file and when view the file size show as 1 KB | Excel Discussion (Misc queries) | |||
How to get the size of the excel file, a sheet size (in bytes)? | Excel Programming |