# Export data to Excel with adjusted column size

I'm trying to export some data with formats into Excel. It works ok, but the columns size get not properly adjusted. I don't want to use some complicated solution based on this example.

In my tests, I tried a code like that:

data = {{"Column 1", "Column 2"}, {1, 4}, {2, 5}, {3, 6}};
data[[1]] = Style[#, Bold, Red, FontSize -> 15] & /@ data[[1]]
Export["data.xlsx", data, "FormattedData"]


I get this result:

And I need something like this:

Some clue?

-
Murta :I am also faceing this problem..did you get it? –  subbu Nov 3 '12 at 6:56
No.. I think that there is no simple way to do that. –  Murta Nov 3 '12 at 15:35
This issue surely could be solved by using the XML format instead of xlsx for exporting. But is is not simple... –  Alexey Popkov Dec 17 '12 at 10:33
@Murta This issue is easily fixed once the file is opened in excel by selecting all of the affected columns and double clicking in the gap between any of the column heads. If you have a lot of files you could write a simple batch macro to do this. –  geordie May 16 at 7:31
@geordie Hi. Yes, I understand, the problem is that this file is automatically created and delivered by mail using MMA. So I would like to make it automatically. –  Murta May 16 at 17:26
show 1 more comment