Get file size

  • Thread starter Thread starter Mohan Manicks
  • Start date Start date
M

Mohan Manicks

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.
 
Mohan Manicks said:
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 *
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top