If you want just the file name with no path information, use
ActiveWorkbook.Name
' or
ThisWorkbook.Name
If you want the full file name including path information, use
ActiveWorkbook.FullName
' or
ThisWorkbook.FullName
ActiveWorkbook refers to the workbook that is active in Excel,
regardless of which workbook contains the code. ThisWorkbook always
refers to the workbook that contains the code, regardless of what
workbook might be active in Excel.
Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC www.cpearson.com
(email on web site)
I hope you don't mind me 'piggy-backing' on your question Fan924, but I'm
looking for the file name, but it's nither the ActiveWorkbook nor
ThisWorkbook. I'm trying to avoid opening each workbook to get verification
inside the file, because the open/close happening across the network takes
too long...
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.