-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How To Check Whether a Sheet Exists? #312
Comments
Good question. Never considered because: If you try to get a worksheet from the workbook, you will get an exception if that fails, which you can catch. I'll implement this once I am done with the current change. |
Then, for now at least, the correct way to handle this is to use try-catch when attempting to get a worksheet from a workbook, right? |
Yes, you could do it like that when attempting to get a worksheet by name. Or - if unsure - you could iterate over the worksheets by index and test the names. |
And with 02f7d42#diff-1875efb653648b982a3e6d1344f92e3947645bac6865095c606a954c7b18d3feR109 you can now access |
Patch has been merged into master |
I know that XLDocument has a bool operator to check for the result of the open() operation.
What to do for sheets? For example, if
worksheetExists( sheet_name )
returns true, does that mean that the sheet opened successfully?The text was updated successfully, but these errors were encountered: