リンクされた図形の値を更新

次のスクリーンショットは、以下のサンプル コードで使用されるソース Excel ファイルを示しています。セル A1 から E4 にリンクされたリンクされた画像があります。セル B4 の値を Aspose.Cells に変更して呼び出します。Worksheet.Shapes.UpdateSelectedValue()写真の値を更新し、PDF 形式で保存するメソッド。

todo:画像_代替_文章

ダウンロードできますソースの Excel ファイルそしてその出力 PDF指定されたリンクから。

C# リンクされた図形の値を更新するコード

// 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);