本文介绍了使用C#在Excel中进行自动调整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我试图自动扩展Excel工作表的行,但无法这样做。



请告诉我怎么办。



以下是我试过的代码。



我尝试过:



obj_Range = objxlApp.get_Range(objxlApp.Cells [(i + 2),1],objxlApp .Cells [(i + 2),dataTable.Columns.Count]);

obj_Range.Font.Bold = true;

obj_Range.Font.Size = 12;

obj_Range.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);

obj_Range.Cells.Interior.Color = System.Drawing .ColorTranslator.ToOle(System.Drawing.Color.SteelBlue);

obj_Range.EntireRow.AutoFit();

obj_Range.Rows.AutoFit();

Hi all

I m trying to expand the rows of a excel sheet automatically, but unable to do so.

Please tell me how to do.

Below is the code i tried.

What I have tried:

obj_Range = objxlApp.get_Range(objxlApp.Cells[(i + 2), 1], objxlApp.Cells[(i + 2), dataTable.Columns.Count]);
obj_Range.Font.Bold = true;
obj_Range.Font.Size = 12;
obj_Range.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);
obj_Range.Cells.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.SteelBlue);
obj_Range.EntireRow.AutoFit();
obj_Range.Rows.AutoFit();

推荐答案

这篇关于使用C#在Excel中进行自动调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 11:59
查看更多