How do I auto size columns through the Excel interop objects?

前端 未结 5 1341
我寻月下人不归
我寻月下人不归 2020-12-02 14:02

Below is the code I\'m using to load the data into an Excel worksheet, but I\'m look to auto size the column after the data is loaded. Does anyone know the best way to auto

5条回答
  •  被撕碎了的回忆
    2020-12-02 14:46

    Also there is

    aRange.EntireColumn.AutoFit();
    

    See What is the difference between Range.Columns and Range.EntireColumn.

提交回复
热议问题