View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default returning filename in excel

Claud

To get the filename of the activeworkbook, use

sFileName=ActiveWorkbook.FullName

If you want to display the open dialog and then open a workbook

sFilename=Application.GetOpenFileName()
Workbooks.Open FileName:=sFileName

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS

"Claud Balls" wrote in message
...
In MS Word I used:
With Dialogs(wdDialogFileOpen)
If .Display Then
strSourceFile = WordBasic.FilenameInfo$(.Name, 1)
End If
End With

to obtain the filename of the active document. How can I do this in
Excel?


*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!