Workbook file name

C

Chip Pearson

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)
 
B

Brenner

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...

Can you all expand a little more on this?

Thanks!
John
 
B

Brenner

I have a post from this morning that explains it a little better. Haven't
gotten it to work yet... :eek:(

Post: fname = Dir() returns and 'invalid procedure call or argument'
12/10/08

Have a good one...
John
 
Top