There is a drawback to using the ActiveWorkbook.FullName or anything else
that relies on the ActiveWorkbook object. If you have more than one
spreadsheet open and force a recalculation for all open workbooks, then any
function that uses ActiveWorkbook will point at the active workbook, not the
workbook that the function resides in. So if Book1 has the
ActiveWorkbook.FullName, and Book2 has focus when the forced recalc is
invoked, Book1 will get the ActiveWorkbook.FullName for Book2.
The other alternatives are to use the CELL function, but there are some
messages on this board that indicates the CELL function can cause Excel to
crash. Not a good thing.
Using the ThisWorkbook is another alternative, but then the user will have
to enter the same code in every workbook that needs the path information.
Again, not a good thing.
The last option is to create a User function that is passed a Range object
that will retrieve the Workbook Path from the passed cell. Ex.
Public Function MyWorkbookPath(PassedCell as Range)
MyWorkbookPath = PassedCell.WorkSheet.Parent.FullName
End Function
This can be placed in an addin, which will allow you to use it wherever you
feel the need, plus, it will not fail since it does not use the
ActiveWorkbook object.
Good luck
Mark