From: Jess on
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



From: Mike H on
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
>
>
>
From: Jess on
How can I also create a footer whose content is the full path followed by the
file name?

Thanks

From: Dave Peterson on
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
From: Gord Dibben on
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 <Jess(a)discussions.microsoft.com>
wrote:

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