public void CopySheet(Sheet originalSheet)
        {
            Excel._Worksheet oSheet = sheetDict[originalSheet];
            Excel._Worksheet endSheet = getEndSheet();
            sheetCounter += 1;

            // Copy Sheet to the last position in the workbook
            oSheet.Copy(Type.Missing,endSheet);

            Excel._Worksheet copySheet = getEndSheet();
            initializeNewSheet(copySheet);
        }
 public Workbook( Excel._Workbook oWB)
 {
     this.oWB = oWB;
     this.workbookSheets = oWB.Sheets;
     foreach (Excel._Worksheet openedWorkSheet in workbookSheets)
     {
         sheetCounter += 1;
         Sheet openedSheet = new Sheet(openedWorkSheet);
         setIndex(openedSheet);
         Sheets.Add(openedSheet);
         sheetDict[openedSheet] = openedWorkSheet;
     }
     this.ActiveSheet = Sheets[0];
 }
 private void setIndex(Sheet addedSheet)
 {
     addedSheet.Index = sheetCounter;
 }
 private void initializeNewSheet(Excel._Worksheet ws)
 {
     Sheet addedSheet = new Sheet(ws);
     setIndex(addedSheet);
     sheets.Add(addedSheet);
     sheetDict[addedSheet] = ws;
     RecentlyAddedSheet = addedSheet;
 }
 private DirectoryLinkWriter SetupSolutionDirectoryWriter()
 {
     string relativeSolutionDirectory = "../../../.";
     testFactory = new LinkSheetFactory(testWorkbook, relativeSolutionDirectory);
     linkSheet = testFactory.ExecuteMake() as Sheet;
     return linkSheet.Writer as DirectoryLinkWriter;
 }
 private void SetupLinkSheet()
 {
     linkSheet = (Sheet)testFactory.ExecuteMake();
 }
 private static void WriterAssertions(Sheet testSheet, DateTime testDate, string pathToDirectory)
 {
     DirectoryLinkWriter sourceWriter = testSheet.Writer as DirectoryLinkWriter;
     Assert.That(testSheet.Writer, Is.InstanceOf<LinkWriter>());
     Assert.That(sourceWriter.LinkDate, Is.EqualTo(testDate));
     Assert.That(sourceWriter.DirectoryPath, Is.EqualTo(pathToDirectory));
 }
 private void SetSheetUtilities(Sheet newSheet)
 {
     newSheet.Writer = sheetWriter;
     newSheet.EmbedTool = sheetTools;
 }