// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(UsingWorkbookMetadata.class);

// Open Workbook metadata
MetadataOptions options = new MetadataOptions(MetadataType.DOCUMENT_PROPERTIES);
WorkbookMetadata meta = new WorkbookMetadata(dataDir + "Sample1.xlsx", options);

// Set some properties
meta.getCustomDocumentProperties().add("test", "test");

// Save the metadata info
meta.save(dataDir + "Sample1.out.xlsx");

// Open the workbook
Workbook w = new Workbook(dataDir + "Sample1.out.xlsx");

// Read document property
System.out.println(w.getCustomDocumentProperties().get("test"));