If a a worksheet name contains one or more apostroph characters (') and if a print area is defined for that worksheet, then __new XLWorkbook("mybook.xlsx")__ fails.
The problem is in XLWorkbook_Load.cs
```
private static void ParseReference(string item, out string sheetName, out string sheetArea)
{
var sections = item.Trim().Split('!');
// If the worksheet name is "D'Artagnan" (encoded as 'D''Artagnan')
// *all* apostrophs will get stripped and we get "DArtagnan" instead of "D'Artagnan"
sheetName = sections[0].Replace("\'", "");
sheetArea = sections[1];
}
```
This will lead to an exception later in the XLWorksheets.Worksheet method.
The attached xlsx file exposes the bug.
Comments: ** Comment from web user: MichaelWalz **
The problem is in XLWorkbook_Load.cs
```
private static void ParseReference(string item, out string sheetName, out string sheetArea)
{
var sections = item.Trim().Split('!');
// If the worksheet name is "D'Artagnan" (encoded as 'D''Artagnan')
// *all* apostrophs will get stripped and we get "DArtagnan" instead of "D'Artagnan"
sheetName = sections[0].Replace("\'", "");
sheetArea = sections[1];
}
```
This will lead to an exception later in the XLWorksheets.Worksheet method.
The attached xlsx file exposes the bug.
Comments: ** Comment from web user: MichaelWalz **
Proposed fix:
```
private static void ParseReference(string item, out string sheetName, out string sheetArea)
{
var sections = item.Trim().Split('!');
sheetName = sections[0] ;
if (sheetName[0] == '\'')
{
sheetName = sections[0].Substring(1, sections[0].Length - 2);
sheetName = sheetName.Replace("\'\'", "\'");
}
sheetArea = sections[1];
}
```