All,
I know how to set a name to a table. But sometimes, if that name already exists (by chance or from left after previous runs of the script), the name instead of setting ot "My Table" would set to is "My Table 2". How do I correctly set it to exactly what I want it to be set to?
I'm looking for a snippet of code that does this - checks if table with this name exasts, if yes, closes or renames old one, and then names this one with exact name I asked for.
I tried Try() function but I probably don't understand entirely how it works. I tried some complex if() statements that gets the list of all the tables and iterates through names etc. It's too long and on big number of tables slows down significantly.
So, I was wondering, what is the CORRECT, conventional way of naming a table so that you're sure the table is named exactly like that?