Show filesize ?


Posted by Chris D on January 17, 2002 9:44 AM

Hi all,

where =cell("filename") displays the name of the file at last save, is it possible to show filesize ?

(I just need the filesize shown in the cell, not as part of the filename)

18 meg and counting, that's VAT for you...

many thanks
Chris

Posted by DK on January 17, 2002 10:35 AM

Hello Chris,

There may be a way to do this with a worksheet function. I seem to remember Juan Pablo posting some sort of function using DOCUMENT but I have no idea how that works. However, this simple function returns the file size of the activeworkbook and it's not perfect...

Function FileSize() As Long
Application.Volatile
FileSize = FileLen(ActiveWorkbook.Path & "\" & ActiveWorkbook.Name)
End Function

Regards,
D

Posted by Chris D on January 17, 2002 11:43 AM

Thanks DK,

I'm having a bit of trouble figuring out where to paste this code...

Chris



Posted by Chris D on January 17, 2002 12:09 PM

Got it, done it...

it checks to the meg value in "properties" too, so works a treat

thanks mate !!
Chris