Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I need a function that will dynamically calculate the current workbook's size
(either in KB of MB) and display it. I wrote the following wrapper function: Public Function FileSize() As Long FileSize = FileLen(ActiveWorkbook.Path & "\" & ActiveWorkbook.Name) End Function It works, except that if you add or remove any data, you have to save, close, and re-open the file for the new size to display. Are there any options that will show the file size after it is saved? Thanks. -- Hmm...they have the Internet on COMPUTERS now! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I didn't have to close and reopen, but I did have to recalculate the workbook.
Just adding: application.volatile To the top of your sub would make that your UDF would recalc whenever excel did. (You could be one calculation behind.) And the workbook has to be saved--since you're asking for the filesize and that doesn't really exist until it's a file. MDW wrote: I need a function that will dynamically calculate the current workbook's size (either in KB of MB) and display it. I wrote the following wrapper function: Public Function FileSize() As Long FileSize = FileLen(ActiveWorkbook.Path & "\" & ActiveWorkbook.Name) End Function It works, except that if you add or remove any data, you have to save, close, and re-open the file for the new size to display. Are there any options that will show the file size after it is saved? Thanks. -- Hmm...they have the Internet on COMPUTERS now! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLOOKUP blows up file size | Excel Worksheet Functions | |||
Size (mb) of sheets in file | Excel Discussion (Misc queries) | |||
Importing .txt data files increases .xls file size | Excel Discussion (Misc queries) | |||
File size increase | Excel Discussion (Misc queries) | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) |