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

Workbook file name. How do I call it up for use in a macro?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Workbook file name

ActiveWorkbook.Name
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Workbook file name

Thanks.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Workbook file name


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)


On Tue, 9 Dec 2008 05:33:13 -0800 (PST), Fan924
wrote:

Workbook file name. How do I call it up for use in a macro?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Workbook file name

Nice. Thanks for the details on ActiveWorkbook & ThisWorkbook


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Workbook file name


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


"Chip Pearson" wrote:

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)


On Tue, 9 Dec 2008 05:33:13 -0800 (PST), Fan924
wrote:

Workbook file name. How do I call it up for use in a macro?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Workbook file name

Not sure what you are asking.
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Workbook file name

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

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

Have a good one...
John


"Fan924" wrote:

Not sure what you are asking.

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
Remove file Protection from an Excel workbook file from others whistler_z Excel Discussion (Misc queries) 2 December 12th 05 06:35 PM
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Excel Programming 1 October 17th 05 08:56 AM
having the same workbook in different file lazmanyak Excel Worksheet Functions 0 July 22nd 05 09:08 AM
"Workbook" file WayneB Excel Worksheet Functions 1 January 28th 05 08:03 PM
Is Workbook read-only because of file permission or because file is already opened? balexis Excel Programming 0 September 29th 04 02:29 PM


All times are GMT +1. The time now is 02:50 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"