Bağlı Şekillerin Değerlerini Yenile

Örnek

Aşağıdaki ekran görüntüsü, aşağıdaki örnek kodda kullanılan kaynak Excel dosyasını gösterir. Bağlantılı bir resim içerir ve A1 ile E4 hücrelerine bağlıdır. Aspose.Cells for Python via .NET kullanarak B4 hücresinin değerini değiştirecek ve ardından Worksheet.Shapes.update_selected_value() yöntemini çağırarak resmin değerini yenileyecek ve PDF formatında 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

from aspose.cells import SaveFormat, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Source directory
sourceDir = RunExamples.Get_SourceDirectory()
# Output directory
outputDir = RunExamples.Get_OutputDirectory()
# Create workbook from source file
workbook = Workbook(sourceDir + "sampleRefreshValueOfLinkedShapes.xlsx")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Change the value of cell B4
cell = worksheet.cells.get("B4")
cell.put_value(100)
# Update the value of the Linked Picture which is linked to cell B4
worksheet.shapes.update_selected_value()
# Save the workbook in PDF format
workbook.save(outputDir + "outputRefreshValueOfLinkedShapes.pdf", SaveFormat.PDF)