none
关于Office 2003开发,Excel中使用Range.Insert方法的错误 RRS feed

  • 问题

  • 大大们好,为了节约大大们的时间,我来介绍一下问题情况:
    1:开发环境:VS.net 2005 C# , windows xP sp2, Office2003
    2:开发描述:引用:com页里的Microsoft Excel 11.0 Object libary
       操作代码:

    Microsoft.Office.Interop.Excel.Workbook Doc;
    Microsoft.Office.Interop.Excel.Worksheet Wks1;
    Microsoft.Office.Interop.Excel.Application App = null;
    App = new Microsoft.Office.Interop.Excel.Application();

    Doc = App.Workbooks.Open(filename.ToString(),
                           missing, missing, missing, missing, missing, missing, missing,
                           missing, missing, missing, missing, missing, missing, missing);
    Wks1 = (Microsoft.Office.Interop.Excel.Worksheet)Doc.Worksheets[1];

    Microsoft.Office.Interop.Excel.Range range = Wks1.get_Range("A6", "I6");
    range.Insert(XlInsertShiftDirection.xlShiftDown, range);
    3:执行结果:range.Insert(XlInsertShiftDirection.xlShiftDown, range);多插入了5,6行空白行,请问大大们这是BUG还是我使用有问题呢?
    2009年2月16日 2:03

答案

全部回复