{"action":"created","issue":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/115","repository_url":"https://api.github.com/repos/ClosedXML/ClosedXML","labels_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/115/comments","events_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/115/events","html_url":"https://github.com/ClosedXML/ClosedXML/issues/115","id":192506599,"number":115,"title":"Exception when calling SaveAs()","user":{"login":"Ludogo","id":9932379,"avatar_url":"https://avatars.githubusercontent.com/u/9932379?v=3","gravatar_id":"","url":"https://api.github.com/users/Ludogo","html_url":"https://github.com/Ludogo","followers_url":"https://api.github.com/users/Ludogo/followers","following_url":"https://api.github.com/users/Ludogo/following{/other_user}","gists_url":"https://api.github.com/users/Ludogo/gists{/gist_id}","starred_url":"https://api.github.com/users/Ludogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ludogo/subscriptions","organizations_url":"https://api.github.com/users/Ludogo/orgs","repos_url":"https://api.github.com/users/Ludogo/repos","events_url":"https://api.github.com/users/Ludogo/events{/privacy}","received_events_url":"https://api.github.com/users/Ludogo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-30T08:43:50Z","updated_at":"2016-11-30T09:14:25Z","closed_at":null,"body":"I don't know why sometime this exception occurs when I call SaveAs for an existing file.\r\nAny idea ? \r\n\r\n{\"Unable to cast object of type 'DocumentFormat.OpenXml.Packaging.SharedStringTablePart' to type 'DocumentFormat.OpenXml.Packaging.WorksheetPart'.\"}\r\n\r\n   at ClosedXML.Excel.XLWorkbook.CreateParts(SpreadsheetDocument document)\r\n   at ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath, SpreadsheetDocumentType spreadsheetDocumentType)\r\n   at ClosedXML.Excel.XLWorkbook.SaveAs(String file)\r\n"},"comment":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/comments/263821836","html_url":"https://github.com/ClosedXML/ClosedXML/issues/115#issuecomment-263821836","issue_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/115","id":263821836,"user":{"login":"Ludogo","id":9932379,"avatar_url":"https://avatars.githubusercontent.com/u/9932379?v=3","gravatar_id":"","url":"https://api.github.com/users/Ludogo","html_url":"https://github.com/Ludogo","followers_url":"https://api.github.com/users/Ludogo/followers","following_url":"https://api.github.com/users/Ludogo/following{/other_user}","gists_url":"https://api.github.com/users/Ludogo/gists{/gist_id}","starred_url":"https://api.github.com/users/Ludogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ludogo/subscriptions","organizations_url":"https://api.github.com/users/Ludogo/orgs","repos_url":"https://api.github.com/users/Ludogo/repos","events_url":"https://api.github.com/users/Ludogo/events{/privacy}","received_events_url":"https://api.github.com/users/Ludogo/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T09:14:25Z","updated_at":"2016-11-30T09:14:25Z","body":"A workaround that works.\r\nI have to manage by myself if file was loaded from file before saving : \r\n ```\r\n                if (isLoadedFromFile)\r\n                {\r\n                    currentFile.Save();\r\n                }\r\n                else\r\n                {\r\n                    currentFile.SaveAs(filePath);\r\n                    currentFile = new XLWorkbook(filePath); //reload after having saved\r\n                    isLoadedFromFile = true;\r\n                }\r\n```\r\n"}}
{"actor":{"display_login":"Ludogo"}}