Forum Discussion
workbook and sheet name via formula
I have a standard header I put on almost every excel workbook I create I have been using for years. It includes several standard items, including Workbook name and Worksheet name, which are extracted via CELL("Filename",A1) formula.
For Excel workbooks that are being viewed in Excel Online, however, whether through onedrive, sharepoint, or whatever, this formula yields a #VALUE! error. When I open in desktop, it renders fine, just not when looking at browser window.
Is there an alternative that I can use to display current workbook and worksheet names via a formula in a cell that is compatible with Excel Online?
Afraid for Excel Online that's only with Office Script, there are properties getName both for workbook and worksheet.
VBA and related functions don't work in Excel Online.
63 Replies
- SergeiBaklanDiamond Contributor
Afraid for Excel Online that's only with Office Script, there are properties getName both for workbook and worksheet.
VBA and related functions don't work in Excel Online.
- liverlarsonBrass Contributor
SergeiBaklan Hmm, wasn't aware of office scripts. From my 30 seconds of research it looks like they are 1) pretty new, 2) basically VBA/macros for online
If I did an office script to accomplish this functionality, does that in any way translate to the workbook when I download it?
Such a simple thing. Seems weird to have to use an online-specific solution. As an aside, do you happen to know why CELL doesn't work online?
- SergeiBaklanDiamond Contributor
You are right, Office Script is relatively new functionality available only for targeted tenants, that means not for everyone so far. And yes, basically they have the same role as VBA/macro for desktop versions, but that's totally different technology. Since the engines which runs online and desktop versions are different.
Back to question, Excel Online has limited functionality compare to desktop version which, however, is expanded quite fast. To my knowledge there is no built-in function which allows to return file/sheet name.
- erol sinan zorluIron Contributor
you need to create a Name like "SheetName" and use GET.CELL(32,A1) in the Refers To area. Whenever you need the sheet name you need to type "=SheetName" in the cell and you will get workbook and sheet name.
This is a Excel 4 Macro and not being supported. You can use it in Names though.