قم بتحديث قيم الأشكال المرتبطة

مثال

تُظهر لقطة الشاشة التالية ملف Excel المصدر المستخدم في نموذج التعليمات البرمجية أدناه. لها صورة مرتبطة بالخلايا A1 إلى E4. سنقوم بتغيير قيمة الخلية B4 مع Aspose.Cells ثم الاتصالورقة العمل الأشكال. UpdateSelectedValue ()طريقة لتحديث قيمة الصورة وحفظها بتنسيق PDF.

ما يجب القيام به: image_بديل_نص

يمكنك تنزيل ملفملف 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);