Beispiel #1
0
        public Worksheet(Workbook wkbk, string name)
        {
            Worksheet ws = wkbk.GetNewWorksheet();

            this.XlWorksheet = ws.XlWorksheet;

            this.Name = name;
        }
        public static void ReorderWorksheets(Workbook wkbk, List<string> orderedWorksheetNames)
        {
            List<string> reversedOnPurpose = new List<string>(orderedWorksheetNames);
            reversedOnPurpose.Reverse();

            foreach (string wsName in reversedOnPurpose)
            {
                Worksheet ws = wkbk.GetWorksheet(wsName);

                XL.Worksheet xlWs = ws.XlWorksheet;

                xlWs.Move(wkbk.XlWorkbook.Sheets[1]);
            }
        }
 public static void RemoveSheet1Sheet2Sheet3(Workbook wkbk)
 {
     wkbk.DeleteWorksheet(@"Sheet1");
     wkbk.DeleteWorksheet(@"Sheet2");
     wkbk.DeleteWorksheet(@"Sheet3");
 }
        public static void HideWorksheet(Workbook wkbk, string name)
        {
            Worksheet ws = wkbk.GetWorksheet(name);

            ws.Hide();
        }
Beispiel #5
0
        public Workbook OpenWorkbook(string fileRootedPath)
        {
            XL.Workbook xlWkbk = this.XlApplication.Workbooks.Open(fileRootedPath);

            Workbook retValue = new Workbook(xlWkbk);
            return retValue;
        }
Beispiel #6
0
        public Workbook GetWorkbook(string name)
        {
            XL.Workbook xlWkbk = this.GetXlWorkbook(name);

            Workbook retValue = new Workbook(xlWkbk);
            return retValue;
        }
Beispiel #7
0
        public Workbook GetNewWorkbook()
        {
            XL.Workbook xlWkbk = this.XlApplication.Workbooks.Add(Missing.Value);

            Workbook retValue = new Workbook(xlWkbk);
            return retValue;
        }
Beispiel #8
0
        public Worksheet(Workbook wkbk)
        {
            Worksheet ws = wkbk.GetNewWorksheet();

            this.XlWorksheet = ws.XlWorksheet;
        }