Hi,
I am trying to create custom document properties linked to the content of named cell but when saving the file it only creates the custom property.
this is my code:
public static void LinkCellToContent(string filePath)
{
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
FileStream inputStream = new FileStream(filePath, FileMode.Open);
IWorkbook workbook = application.Workbooks.Open(inputStream, ExcelVersion.Xlsx);
workbook.CustomDocumentProperties["lugar"].Value = "";
workbook.CustomDocumentProperties["lugar"].LinkSource = "=$Ciudad"; //I don't know how to link to the named cell
workbook.CustomDocumentProperties["lugar"].LinkToContent = true;
inputStream.Close();
FileStream outputStream = new FileStream("metadato.xlsx", FileMode.Create);
workbook.SaveAs(outputStream);
workbook.Close();
outputStream.Position = 0;
outputStream.Close();
Console.WriteLine("SUCCESS");
}
This is the named cell:
how can i use cell value as custom document property using XlsIo?
Hi,
thanks for the reply
I already installed the patch but it just takes the cell value and puts it in the document property value, it does not link to the content
this is my code: