View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
David McRitchie[_2_] David McRitchie[_2_] is offline
external usenet poster
 
Posts: 134
Default VBA to read spreadsheet's filename?

Which is probably what Jon really would wanted but not what he asked for.
More details on my http://www.mvps.org/dmcritchie/excel/pathname.htm
Page also has worksheet solutions as well as main emphasis on headers/footers..

Code in VBA
Description VBA codeExample
Full Name: Application.ActiveWorkbook.FullName D:\TestFolder\test.xls
Path: Application.ActiveWorkbook.Path C:\MSOffice\Excel
Filename: Application.ActiveWorkbook.Name test.xls
Sheetname: application.activesheet.name Sheet1
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"losmac" wrote in message ...
MsgBox ThisWorkbook.FullName

losmac

Uzytkownik "Jon" napisal w wiadomosci
om...
Hi,

I'm a novice at Excel VBA and looking for a way to retrieve the
filename (e.g. asdfasdf.xls) of the current spreadsheet. Is there a
way to do this?

Thanks
Jon