I have a function in Javascript that Exports data to a new Excel file. I'm using ActiveXObejct("Excel.Application") to work with Excel. After The Export of the data is done and I see the result, the data overflows the width of the columns. This is causing some of the data look cut in the table. For example if I have the data '1234567890' in a cell I would see '123456' or '######' in the cell. So how can I control the width of the columns to fit the data they contain? This is a code example of what I'm generally doing:
var Excel = new ActiveXObject("Excel.Application");
var Sheet = new ActiveXObject("Excel.Sheet");
for (var i = 0 ; i < DataArray.length ; i++)
Sheet.ActiveSheet.Cells(i+1,1).value = DataArray[i];
Excel.visible = true;