Bağlı Şekillerin Değerlerini Yenile

Örnek

Aşağıdaki ekran görüntüsü, örnek kodda kullanılan kaynak Excel dosyasını göstermektedir. A1’den E4’e kadar olan hücrelere bağlı bir resim içerir. Aspose.Cells ile B4 hücresinin değerini değiştirecek ve ardından Worksheet.Shapes.UpdateSelectedValue() yöntemini çağırarak resmin değerini yenileyip PDF biçiminde kaydedeceğiz.

todo:image_alt_text

Verilen bağlantılardan kaynak Excel dosyasını ve çıktı PDF’sini indirebilirsiniz.

Bağlı şekillerin değerlerini yenilemek için C# kodu

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Source directory
string sourceDir = RunExamples.Get_SourceDirectory();
//Output directory
string outputDir = RunExamples.Get_OutputDirectory();
// Create workbook from source file
Workbook workbook = new Workbook(sourceDir + "sampleRefreshValueOfLinkedShapes.xlsx");
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Change the value of cell B4
Cell cell = worksheet.Cells["B4"];
cell.PutValue(100);
// Update the value of the Linked Picture which is linked to cell B4
worksheet.Shapes.UpdateSelectedValue();
// Save the workbook in PDF format
workbook.Save(outputDir + "outputRefreshValueOfLinkedShapes.pdf", SaveFormat.Pdf);