Enum MemorySetting

MemorySetting enumeration

Memory usage options.

public enum MemorySetting

Values

NameValueDescription
Normal0Default option for cells model.
MemoryPreference1Memory performance preferrable. With this option the data will be held in compact format so for common scenarios it may give lower memory cost. However, this option also may degrade R/W performance a bit in some special cases.

Examples

[C#]

namespace Demos
{
    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