{"action":"opened","issue":{"url":"https://api.github.com/repos/guyonroche/exceljs/issues/35","labels_url":"https://api.github.com/repos/guyonroche/exceljs/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/guyonroche/exceljs/issues/35/comments","events_url":"https://api.github.com/repos/guyonroche/exceljs/issues/35/events","html_url":"https://github.com/guyonroche/exceljs/issues/35","id":111780084,"number":35,"title":"Corrupt xlsx after updating","user":{"login":"hbostic","id":1597052,"avatar_url":"https://avatars.githubusercontent.com/u/1597052?v=3","gravatar_id":"","url":"https://api.github.com/users/hbostic","html_url":"https://github.com/hbostic","followers_url":"https://api.github.com/users/hbostic/followers","following_url":"https://api.github.com/users/hbostic/following{/other_user}","gists_url":"https://api.github.com/users/hbostic/gists{/gist_id}","starred_url":"https://api.github.com/users/hbostic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbostic/subscriptions","organizations_url":"https://api.github.com/users/hbostic/orgs","repos_url":"https://api.github.com/users/hbostic/repos","events_url":"https://api.github.com/users/hbostic/events{/privacy}","received_events_url":"https://api.github.com/users/hbostic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-16T07:54:01Z","updated_at":"2015-10-16T07:54:01Z","closed_at":null,"body":"Hello, great lib,  I have an issue with the following code whereby the updated file become corrupt.  The val you see in code is a string version of a bool so \"true\" or \"false\", I did hardcode a string as val (\"hello\"), just to see if it was the bool that caused the issue, but the file still got corrupted.  Can you please take a look and see what I may be doing wrong, thanks.  If I am able to recover the file, it has the updated value, but my app is no longer able to read the file for subsequent parsing\r\n\r\nfunction updateExcelEntry(inputPage,sheet,colKeyIndex,colIndexToUpdate,rowKey,val){\r\n    //console.log(\"in excel \" + inputPage);\r\n    var workbook = new Excel.Workbook();\r\n    workbook.xlsx.readFile(inputPage).then(function() {\r\n            // use workbook\r\n        //console.log(\"getting sheet \" + sheet);\r\n        var worksheet = workbook.getWorksheet(sheet);\r\n        //console.log(\"getting keyCol \" + colKeyIndex);\r\n        var keyCol = worksheet.getColumn(colKeyIndex);\r\n        keyCol.key = \"key\";\r\n        var col = worksheet.getColumn(colIndexToUpdate);\r\n        col.key = \"colToUpdate\";\r\n\r\n        worksheet.eachRow(function(row, rowNumber) {\r\n\r\n            //console.log(\"checking key val \" + row.getCell(\"key\").value);\r\n            //console.log(\"vs rowKey \" + rowKey);\r\n            if(rowNumber !== 1 && row.getCell(\"key\").value === rowKey){\r\n                //console.log(\"Row \" + rowNumber + \" = \" + JSON.stringify(row.values));\r\n                row.getCell(\"colToUpdate\").value = val;\r\n\r\n            }\r\n        });\r\n\r\n\r\n    }).then(function() {\r\n        return workbook.xlsx.writeFile(inputPage)\r\n    }).then(function() {\r\n        console.log(\"workbook updated \" + inputPage);\r\n    });\r\n}"}}