示例#1
0
 public MMRng(MMWS aOwner, string sCellA, string sCellB)
 {
     Owner = aOwner;
     CellA = sCellA;
     CellB = sCellB;
     Rng   = aOwner.WS.get_Range(CellA, CellB);
 }
示例#2
0
        public void New()
        {
            if (xlBook == null)
            {
                if (xlApp == null)
                {
                    xlApp = new Excel.Application();
                }
                xlBook = xlApp.Workbooks.Add(mv);
                xlBook.CheckCompatibility = false;

                MMWS aWS = new MMWS(this, xlBook.Worksheets.get_Item(1));
                Sheet.Add(aWS);
            }
            else
            {
                Close();
                New();
            }
        }
示例#3
0
 public void Open(string sFileNamePath)
 {
     if (xlBook == null)
     {
         if (xlApp == null)
         {
             xlApp = new Excel.Application();
         }
         FilePathName = sFileNamePath;
         xlBook       = xlApp.Workbooks.Open(FilePathName, true, false, mv, mv, mv, mv, mv, mv, true, mv, mv, mv, mv, mv);
         xlBook.CheckCompatibility = false;
         Int32 iSheetCount = xlBook.Sheets.Count;
         for (Int32 i = 1; i <= iSheetCount; i++)
         {
             MMWS aWS = new MMWS(this, xlBook.Worksheets.get_Item(i));
             Sheet.Add(aWS);
         }
     }
     else
     {
         Close();
         Open(sFileNamePath);
     }
 }