{"action":"created","issue":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1142","repository_url":"https://api.github.com/repos/ClosedXML/ClosedXML","labels_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1142/labels{/name}","comments_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1142/comments","events_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1142/events","html_url":"https://github.com/ClosedXML/ClosedXML/issues/1142","id":407354257,"node_id":"MDU6SXNzdWU0MDczNTQyNTc=","number":1142,"title":"How to make Excel treat all cells as text and avoid any automatic conversions","user":{"login":"sdg002","id":20245330,"node_id":"MDQ6VXNlcjIwMjQ1MzMw","avatar_url":"https://avatars1.githubusercontent.com/u/20245330?v=4","gravatar_id":"","url":"https://api.github.com/users/sdg002","html_url":"https://github.com/sdg002","followers_url":"https://api.github.com/users/sdg002/followers","following_url":"https://api.github.com/users/sdg002/following{/other_user}","gists_url":"https://api.github.com/users/sdg002/gists{/gist_id}","starred_url":"https://api.github.com/users/sdg002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdg002/subscriptions","organizations_url":"https://api.github.com/users/sdg002/orgs","repos_url":"https://api.github.com/users/sdg002/repos","events_url":"https://api.github.com/users/sdg002/events{/privacy}","received_events_url":"https://api.github.com/users/sdg002/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-02-06T17:46:26Z","updated_at":"2019-02-08T13:02:32Z","closed_at":"2019-02-08T13:02:32Z","author_association":"NONE","body":"![issue](https://user-images.githubusercontent.com/20245330/52361898-3a3aa300-2a37-11e9-8b65-38faaf4749c7.png)\r\n[Sample.XLSX](https://github.com/ClosedXML/ClosedXML/files/2837602/Sample.XLSX)\r\n\r\n## Read and complete the full issue template\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n- [x] Bug\r\n- [ ] Feature\r\n\r\nIf you are logging a possible bug or feature request, please test with [the latest development build](https://ci.appveyor.com/project/ClosedXML/ClosedXML/branch/develop/artifacts) first.\r\n\r\n**Version of ClosedXML**\r\n\r\ne.g. 0.94.2.0\r\n\r\n**What is the current behavior?**\r\n\r\nWhen writing to Excel using XLDataType.Text format,  \r\n1)Excel is stripping the \"+\" sign from \"+100.123\"\r\n2)Excel is converting a string like \"10/01/2019\"  to 43475\r\n3)Excel is displaying a warning drop down icon on each of the cells \r\n\r\n**What is the expected behavior or new feature?**\r\n\r\nI would like Excel to retain the original string as it is.\r\n\"+100.123\" from C# should be seen as \"+100.123\" in Excel\r\n\"10/01/2019\" from C# should be seen as  \"10/01/2019\"\r\nNo data conversion warning icons should appear in Excel.\r\n\r\nPlease note that in my scenario, I have no prior knowledge of the underlying data type. I have to treat all cells as plain text and hence using XLDataType.Text.\r\n\r\n**Did this work in previous versions of our tool?  Which versions?**\r\n\r\nNot sure. This is the first time I am trying out.\r\n\r\n## Reproducibility\r\n**This is an important section. Read it carefully. Failure to do so will cause a 'RTFM' comment.**\r\n\r\nWithout a code sample, it is unlikely that your issue will get attention. Don't be lazy. Do the effort and assist the developers to reproduce your problem. Code samples should be [minimal complete and verifiable](https://stackoverflow.com/help/mcve). Sample spreadsheets should be attached whenever applicable. Remove sensitive information.\r\n\r\n**Code to reproduce problem:**\r\n```c#\r\n        [TestMethod]\r\n        public void DataTypesIssue()\r\n        {\r\n            string filename = DateTime.Now.ToString(\"ddd-HH-mm-ss\") + \".XLSX\";\r\n            string file = System.IO.Path.Combine(Util.GetTempDir(), filename);\r\n            using (var workbook = new XLWorkbook())\r\n            {\r\n                {\r\n                    var worksheet = workbook.Worksheets.Add(\"Sample Sheet With data types\");\r\n                    worksheet.Cell(\"A1\").Value = \"Positive Number with plus sign\";\r\n                    worksheet.Cell(\"B1\").Value = $\"+100.123\";\r\n                    worksheet.Cell(\"B1\").DataType = XLDataType.Text;\r\n\r\n                    worksheet.Cell(\"A2\").Value = \"Positive Number without plus sign\";\r\n                    worksheet.Cell(\"B2\").Value = $\"100.123\";\r\n                    worksheet.Cell(\"B2\").DataType = XLDataType.Text;\r\n\r\n                    worksheet.Cell(\"A3\").Value = \"Negative Number\";\r\n                    worksheet.Cell(\"B3\").Value = $\"-100.123\";\r\n                    worksheet.Cell(\"B3\").DataType = XLDataType.Text;\r\n                    worksheet.ExpandColumns();\r\n                    worksheet.ExpandRows();\r\n\r\n                    worksheet.Cell(\"A4\").Value = \"Date example\";\r\n                    worksheet.Cell(\"B4\").Value = $\"10/01/2019\";\r\n                    worksheet.Cell(\"B4\").DataType = XLDataType.Text;\r\n                    worksheet.ExpandColumns();\r\n                    worksheet.ExpandRows();\r\n\r\n                }\r\n                workbook.SaveAs(file);\r\n            }\r\n        }\r\n\r\n```\r\n- [ ] I attached a sample spreadsheet.  (You can drag files on to this issue)\r\n"},"comment":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/comments/461795867","html_url":"https://github.com/ClosedXML/ClosedXML/issues/1142#issuecomment-461795867","issue_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1142","id":461795867,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2MTc5NTg2Nw==","user":{"login":"igitur","id":145854,"node_id":"MDQ6VXNlcjE0NTg1NA==","avatar_url":"https://avatars1.githubusercontent.com/u/145854?v=4","gravatar_id":"","url":"https://api.github.com/users/igitur","html_url":"https://github.com/igitur","followers_url":"https://api.github.com/users/igitur/followers","following_url":"https://api.github.com/users/igitur/following{/other_user}","gists_url":"https://api.github.com/users/igitur/gists{/gist_id}","starred_url":"https://api.github.com/users/igitur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igitur/subscriptions","organizations_url":"https://api.github.com/users/igitur/orgs","repos_url":"https://api.github.com/users/igitur/repos","events_url":"https://api.github.com/users/igitur/events{/privacy}","received_events_url":"https://api.github.com/users/igitur/received_events","type":"User","site_admin":false},"created_at":"2019-02-08T13:02:32Z","updated_at":"2019-02-08T13:02:32Z","author_association":"MEMBER","body":"@sdg002 No, that's an Excel function and not something controlled by the workbook."}}
{"actor":{"display_login":"igitur"}}