I’m getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ?
- The name that you type does not exceed 31 characters. The name does
- not contain any of the following characters: : \ / ? * [ or ]
- You did not leave the name blank.
To do worksheet validation for those specified invalid characters using Regex, you can use something like this:
This also includes a check to see if the worksheet name is null or empty, or if it’s greater than 31. Those two checks aren’t done via Regex for the sake of simplicity and to avoid over engineering this problem.