C#自动调整方法Excel工作表 [英] C# Autofit method for excel sheet
本文介绍了C#自动调整方法Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建使用C#.NET一个Excel工作表。最后,我要自动调整列。 我使用下面的code。
I am creating an excel sheet using C# .net. In the end I want to autofit the columns. I am using following code.
sheet0.Cells["A2:B2"].Columns.AutoFit();
但它是thorowing异常。 谁能帮我解决这个问题?
But it is is thorowing an exception. Can anyone help me solve this?
感谢你。
推荐答案
尝试做这样的:
sheet0.Columns["A:B"].AutoFit();
这篇关于C#自动调整方法Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文