Excel - List Sheet Names Coming up as Blocked

I want to make a list of sheet names in an Excel workbook. I used the following to set this up:

  1. Go to the Formulas tab.

  2. Press the Define Name button.

  3. Enter SheetNames into the name field.

  4. Enter the following formula into the Refers to field.

    =REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"")
  5. Hit the OK button.

  6. Enter Index in A1 and SheetNames in B1

  7. Starting in A2 enter 1,2,3,... for all sheets in workbook.

  8. In B2 enter =INDEX(SheetNames,A2). Copy and paste this down the column.

This worked once. I saved the workbook as a macro-enabled workbook but now I just get #BLOCKED! as a result instead of the sheet name.

I did rearrange the sheets but even re-creating the above still gives me #BLOCKED!.

I'm working with Office365 on a PC with Windows 10.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Re: "I want to make a list of sheet names in an Excel workbook"

Here is a vba code option for you...

'---[Edited]

Sub ListSheetNames()
Dim Ndx As Long, sh As Object

Ndx = 2
With ThisWorkbook.Worksheets(1)
.Cells(Ndx, 1).Resize(ThisWorkbook.Sheets.Count * 2, 1).ClearContents
For Each sh In ThisWorkbook.Sheets
.Cells(Ndx, 1).Value = sh.Name
Ndx = Ndx + 2
Next 'sh
End With
End Sub

'---


Nothing Left to Lose

https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU

(try the free 'Add TableofContents' workbook)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi, I'm Elise, and I'd be happy to help with your issue.

It could be a few reasons why you get this, there is a list of troubleshooting steps you can follow here:

https://support.microsoft.com/en-us/office/how-...

Please let me know if you need any further assistance.

Kind Regards,
Elise

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi I got the same question. It worked fine in a particular workbook yesterday, but it isn't now. I have tried re-defining & re-inputting the formulas, still get #BLOCKED.

However, it works in a new workbook. So it's kind of weird which I have no idea on how to solve the #BLOCKED in my original workbook and afraid the same will happen again even if I switch all the data to that new workbook.

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi I got the same question. It worked fine in a particular workbook yesterday, but it isn't now. I have tried re-defining & re-inputting the formulas, still get #BLOCKED.

However, it works in a new workbook. So it's kind of weird which I have no idea on how to solve the #BLOCKED in my original workbook and afraid the same will happen again even if I switch all the data to that new workbook.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

RE: "still get blocked"

As EliseM_456 referenced, xl4 Macros have been disabled in recent versions of Excel.

The Get.Workbook function is an xl4 function and is listed in the Microsoft Excel

Function Reference book, copyright 1992 (536 pages)
Even if the function works occasionally, you should find a replacement.

MS continually finds ways to obsolete earlier versions of its programs and force

users into the monthly rental program for the current versions.

'---

Nothing Left to Lose

5 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for your reply!

My office should be a 2016 one with windows 10, so that means it may just like what you said.

However, I'm a non-macro/VBA user and dont quite sure how I should incorporate the vba code you mentioned at the beginning. May I know do you have any other non-vba recommendation as a replacement of this xl4 function (which I was just copying and pasting formulas to make it works)?

I got loads of tabs with and would like to get all those tab names at once and make them with hyperlinked.

Thank you!

3 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Re: "I got loads of tabs with and would like to get all those tab names at once and make them with hyperlinked."..."do you have any other non-vba recommendation as a replacement of this xl4 function"

Yes, I do. The free "Add Table of Contents" workbook will create a TOC for any (single) open workbook.

Each name on the TOC is hyperlinked to the named worksheet.

The list is generated in the visible range on the new sheet (the list goes down and then across). I have a ~180 sheet workbook that uses it. Easy to use, just

a couple of clicks...

Note: if you want to create a deeper list, hide the formula bar or the Ribbon before

creating the TOC list.

Download from OneDrive...

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Re: Add Table of Contents workbook

Would like to hear if you tried the workbook and if so, were there

any problems with it.

Nothing Left to Lose

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Sorry, I have been away for a bit. Yes!! the Table of Contents does work and hiding the Ribbon did let the list go farther down. I only have 22 sheets right now and it was starting a new column around sheet 18 I think.

As I add sheets to the workbook, can I refresh the TOC within the workbook? Or do I call up the TOC workbook and run it again?

Thank you for sharing this with us. It is quite useful and you are very kind to do so.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for your reply. I've been away for a bit. Today when I opened the workbook, it came up with a warning about Trusted Macros or something (sorry I didn't take a screenshot and now it's gone). I clicked on that and enabled xl4 Macros and everything seems to work again - even after closing and reopening the workbook. Yea!

Also the Table of Contents that Nothing Left to Lose shared works well too.

Thanks all for your help!

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated May 15, 2024 Views 6,636 Applies to: