Enum MemorySetting

MemorySetting enumeration

Memory usage modes for cells data model.

public enum MemorySetting

Values

NameValueDescription
Normal0Default mode for cells model.
MemoryPreference1Memory performance preferable.
FileCache2Memory performance preferable and using file instead of memory to maintain the cells data.

Examples

namespace AsposeCellsExamples
{
    using Aspose.Cells;
    using System;

    public class MemorySettingDemo
    {
        public static void MemorySettingExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Access the workbook settings
            WorkbookSettings settings = workbook.Settings;

            // Set the memory usage option to MemoryPreference
            settings.MemorySetting = MemorySetting.MemoryPreference;

            // Create a worksheet and add some data
            Worksheet worksheet = workbook.Worksheets[0];
            worksheet.Cells["A1"].PutValue("Sample Data");
            worksheet.Cells["A2"].PutValue(123);

            // Save the workbook
            workbook.Save("MemorySettingExample.xlsx");

            Console.WriteLine("Workbook saved with MemorySetting.MemoryPreference.");
        }
    }
}

See Also