Aspose.Cells.Examples.CSharp.Articles.UsingCellsFactory.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Create a Style object using CellsFactory class
            CellsFactory cf = new CellsFactory();
            Style st = cf.CreateStyle();

            // Set the Style fill color to Yellow
            st.Pattern = BackgroundType.Solid;
            st.ForegroundColor = Color.Yellow;

            // Create a workbook and set its default style using the created Style object
            Workbook wb = new Workbook();
            wb.DefaultStyle = st;

            // Save the workbook
            wb.Save(dataDir + "output_out.xlsx");
            // ExEnd:1
        }
    }
UsingCellsFactory