【发布时间】:2011-10-14 15:44:33
【问题描述】:
错误语句显示“无法获取 Range 类的 AutoFill 属性”。但是,正如我检查的那样,AutoFill 属性确实在 Range Class 中。有谁知道如何解决这个错误? 我已经尝试在谷歌搜索,并没有适当的答案。我也试过在 VBA 中转换代码,它在 VB 中运行良好。
using Microsoft.Office.Interop.Excel;
Application.Range["H2"].Select();
Selection.AutoFill(Destination: mdlAMain.xlApp.Range["H2", "H" + myRow],
Type: XlAutoFillType.xlFillDefault);
【问题讨论】:
-
我试过这个 ApplicationRange["H2"].AutoFill(Destination: mdlAMain.xlApp.Range["H2", "H" + myRow], Type: XlAutoFillType.xlFillDefault);错误是“Range 类的 AutoFill 方法失败”
标签: c# excel com-interop