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

Is there a way to get the file size (in KB) into
Excel sheet through VBA. I am already opening this text
file and copying the contents into the excel sheet through
VBA. I also want to get the file size & file name.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Get file size

"Mohan Manicks" wrote in message
...
Is there a way to get the file size (in KB) into
Excel sheet through VBA. I am already opening this text
file and copying the contents into the excel sheet through
VBA. I also want to get the file size & file name.


Hi Mohan,

The FileLen function will return the size of the specified file in
bytes. You can get KB by dividing the number of bytes by 1024.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Get file size

Mohan,

not sure what you are doing in terms of opening a text file, but this will
return the size of an open workbook.

msgbox filelen(activeworkbook.fullname)

Robin Hammond
www.enhanceddatasystems.com

"Mohan Manicks" wrote in message
...
Is there a way to get the file size (in KB) into
Excel sheet through VBA. I am already opening this text
file and copying the contents into the excel sheet through
VBA. I also want to get the file size & file name.






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
WHY IS MY FILE SO BIG? How can I reduce the size of a file? I h. Julieeeee Excel Discussion (Misc queries) 5 December 17th 04 11:20 PM


All times are GMT +1. The time now is 06:42 AM.

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

About Us

"It's about Microsoft Excel"