Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Get File Size

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Get File Size

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Get File Size

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Get File Size

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Get File Size

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
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
File Size With Macros Has Increased From Its Origina Size Fred Excel Discussion (Misc queries) 1 April 26th 08 12:24 AM
Unusual File Size in Excel file Teck Excel Discussion (Misc queries) 2 January 12th 07 01:52 AM
how to set sheet size to reduce file size LJ Excel Discussion (Misc queries) 1 November 26th 06 02:35 AM
Unable to open excel file and when view the file size show as 1 KB Kamal Siva Excel Discussion (Misc queries) 1 March 7th 06 03:23 AM
How to get the size of the excel file, a sheet size (in bytes)? bookworm98[_13_] Excel Programming 1 January 28th 04 02:59 PM


All times are GMT +1. The time now is 07:38 PM.

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

About Us

"It's about Microsoft Excel"