WorkbookMetadata.Save

Save(string)

Save the modified metadata to the file.

public void Save(string fileName)
ParameterTypeDescription
fileNameStringThe file name.

Examples

using System;
using Aspose.Cells;
using Aspose.Cells.Metadata;

namespace AsposeCellsExamples
{
    public class WorkbookMetadataMethodSaveWithStringDemo
    {
        public static void Run()
        {
            // Create a new workbook metadata
            WorkbookMetadata doc = new WorkbookMetadata("example.xlsb", new MetadataOptions(Aspose.Cells.Metadata.MetadataType.DocumentProperties));
            
            // Add custom properties
            doc.CustomDocumentProperties.Add("text1", "text2");
            doc.CustomDocumentProperties.Add("num1", 1);
            
            // Save with string path
            doc.Save("output.xlsb");
            
            // Verify the saved file
            Workbook workbook = new Workbook("output.xlsb");
            Console.WriteLine("File saved successfully with custom properties.");
            Console.WriteLine("Property 'text1' value: " + doc.CustomDocumentProperties["text1"].Value.ToString());
        }
    }
}

See Also


Save(Stream)

Save the modified metadata to the stream.

public void Save(Stream stream)
ParameterTypeDescription
streamStreamThe stream.

See Also