workSheet 复制粘贴sheet的部分数据问题
本帖最后由 锦鲤本李 于 2024-9-3 16:32 编辑复制粘贴区域数据后 单元格的计算式会变化,怎么解决
把sheet2中红框内的数据A3:A32(图1)复制到sheet1的指定位置(A45:A76)后,计算式发生变化(图2),但是粘贴到sheet1与sheet2同样的位置(A3:A32),计算式显示正确(图3)
代码:
SpreadsheetGear.IWorkbookSet excelApp = SpreadsheetGear.Factory.GetWorkbookSet();
SpreadsheetGear.IWorkbook workBook = null;
SpreadsheetGear.IWorksheet sheet = null;
SpreadsheetGear.IWorksheet sheet2 = null;
workBook = excelApp.Workbooks.Open(文件路径);
int copyRowCount = Selp921922mSheet2PageCount * SHEET2_MAX_ROW_2;//复制的行数
sheet2 = (SpreadsheetGear.IWorksheet)workBook.Sheets;
string sCopyArea = "A3:" + "T" + copyRowCount;//复制区域
SpreadsheetGear.IRange cells2 = sheet2.Cells;
SpreadsheetGear.IRange rangeFrom = cells2.EntireRow;
string sPasteArea = "A" + SHEET1_MAX_ROW + ":T" + (SHEET1_MAX_ROW + copyRowCount).ToString();//粘贴区域
sheet = (SpreadsheetGear.IWorksheet)workBook.Sheets;
SpreadsheetGear.IRange cells = sheet.Cells;
SpreadsheetGear.IRange rangeTo = cells.EntireRow;
rangeFrom.Copy(rangeTo, SpreadsheetGear.PasteType.All,
SpreadsheetGear.PasteOperation.None, false, false);
你好
日文版问题请通过下面的日文产品网站链接咨询
https://www.grapecity.co.jp/developer/support
我们这边目前没有资料来验证日文版产品的相关问题。也已经停止销售日文版了
页:
[1]