If you're trying to catch possible errors before a rename, maybe you could just
try it and check for an error:
dim myNewName as string
mynewname = inputbox(prompt:="new name?")
if trim(mynewname) = "" then
exit sub
end if
with activesheet
on error resume next
.name = myNewName
if err.number <> 0 then
'something went wrong--maybe the length, maybe something else
msgbox "not renamed!
err.clear
end if
on error goto 0
end with
There are lots of other things that cause rename errors besides the length of
the suggested new name.