View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
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