checking name of file

  • Thread starter Thread starter clayton
  • Start date Start date
C

clayton

How can I check the name of a file?
What I want to do it this. When an excel file is opened it should check
to see if its own filename is whatever.xls. If it is then continue
running the macro. If not that filename to stop or to run different
macro. It’s this possible?
 
Clayton,

Do you not know the workbook name when you open it?

Anyways,

If ActiveWorkbook.Name <> "whatever.xls" Then
'do whatever when it isn't
Else
'do whatever when it is
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
The original file name is known. If this is not the original file nam
then run this. If it is the original file then run this. I think wha
you have given me here will work. Thanks for your reply :
 
Back
Top