gpt4 book ai didi

c# - Excel 互操作 - 取消选择

转载 作者:行者123 更新时间:2023-12-02 06:21:36 28 4
gpt4 key购买 nike

我正在 Excel 工作表中复制并插入行,如下所示:

   while (rowsToAdd > 0)
{
// copy the existing row
insertionCell.EntireRow.Copy(Type.Missing);

// location of the new row
Range newRow = insertionCell.EntireRow.get_Offset(1, 0).EntireRow;

// insert the new row
newRow.Insert(XlInsertShiftDirection.xlShiftDown, Type.Missing);

rowsToAdd--;
}

我遇到的问题是,有时,我最初复制的行周围会留下一个选择框。

有没有办法可以取消选择选取框(通常使用 Escape 键执行此操作的方式?)

最佳答案

在 VBA 中,它是 Application.CutCopyMode = False

关于c# - Excel 互操作 - 取消选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12380181/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com