How can I find the name of all tables in Excel?

Did you change workSheet to something else? Let’s rule that out as the problem. You have a variable named the same as its type.