Filename formula not working

StephenBart

New Member
Joined
Jun 22, 2023
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I am running office 365 on my desktop.

I have a template with a cell B4 with the formula = Cell("Filename", A1).

When I create a worksheet from this template the formula in Cell B4 returns #value error

If I save the workbooks as book1.xls the error persists.

If I close the now saved work book when I reopen the book cell B4 returns the value Book1.xls as expected.

However if I then save as Book2.xls the value in the cell B4 is still Book1.xls - I have to close and reopen Book2.xls to update this cell.

Its like the formula is returning the filename when the workbook was last closed, not last saved (i.e., not the current filename)?

Does anyone know a way to have a cell display the current filename with out having to close and reopen the workbook?

Thank you
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You don't need to close and reopen the workbook but you do need to do something in the spreadsheet that triggers it to recalculate.
You can:
• Press F9 which runs recalculate
• Enter / change something in any cell
• Put a recalculate command in the workbook module which triggers when the spreadsheet is saved but this will mean you need to make the spreadsheet macro enables (xlsm or xlsb).
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top