Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default File Name and Full Path Name

How can I get in excel the file name and the full path to the file? Is there
a VBA command that retrieves this info?

Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default File Name and Full Path Name

Hi

mypath = ThisWorkbook.FullName
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Jess" wrote:

How can I get in excel the file name and the full path to the file? Is there
a VBA command that retrieves this info?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default File Name and Full Path Name

How can I also create a footer whose content is the full path followed by the
file name?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default File Name and Full Path Name

Dim wkbk as workbook
set wkbk = activeworkbook 'thisworkbook or workbooks("book1.xls")

msgbox wkbk.name
msgbox wkbk.Fullname
msgbox wkbk.Path

If you're creating a new workbook in your code and you want to test to see if
it's been saved:

if wkbk.path = "" then
'not saved
else
'saved
end if



Jess wrote:

How can I get in excel the file name and the full path to the file? Is there
a VBA command that retrieves this info?

Thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default File Name and Full Path Name

Delete what you don't want.

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = ActiveWorkbook.FullName & " " & _
ActiveSheet.Name & " " & Application.UserName & " " & Date
End Sub


Gord Dibben MS Excel MVP

On Thu, 28 Jan 2010 12:14:01 -0800, Jess
wrote:

How can I also create a footer whose content is the full path followed by the
file name?

Thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default File Name and Full Path Name

Choose Insert Footer and put this in the Left, Center, or Right Footer

&[Path]&[File]&[File]

Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"Jess" wrote:

How can I also create a footer whose content is the full path followed by the
file name?

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default File Name and Full Path Name

Correction:

&[Path]&[File]


--
Cheers,
Ryan


"Jess" wrote:

How can I also create a footer whose content is the full path followed by the
file name?

Thanks

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 names with full path Eddy Stan Excel Programming 1 May 1st 09 07:19 AM
Keep full file path in cell reference dan Excel Discussion (Misc queries) 0 December 6th 06 12:26 AM
Is it possible to get full file path in titlebar? screenwriter Excel Programming 1 September 26th 06 05:11 PM
full path of excel file Song Excel Discussion (Misc queries) 2 August 21st 05 06:50 PM
Getting the full path when from a File Open Dialog Box Ric Payne Excel Programming 3 July 10th 03 04:58 PM


All times are GMT +1. The time now is 02:37 PM.

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

About Us

"It's about Microsoft Excel"