أضف Cells إلى Microsoft نافذة مشاهدة Excel Formula
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
Microsoft Excel Watch Window هي أداة مفيدة لمشاهدة قيم الخلية وصيغها بسهولة في النافذة. يمكنك فتح ملفمشاهدة النافذة باستخدام Microsoft Excel بالضغط علىالصيغ> مشاهدة نافذة او شباك. لديهاأضف مشاهدةزر يمكن استخدامه لإضافة الخلايا للفحص. وبالمثل ، يمكنك استخدام ملفاتWorksheet.CellWatches.Add ()طريقة لإضافة الخلايا إليهامشاهدة النافذةباستخدام Aspose.Cells API.
أضف Cells إلى Microsoft نافذة مشاهدة Excel Formula
يعيّن نموذج التعليمات البرمجية التالي صيغة الخليتين C1 و E1 ويضيف كلاهما إلى Watch Window. ثم يحفظ المصنف باسمإخراج ملف Excel . إذا قمت بفتح ملف Excel الناتج وعرض ملفمشاهدة النافذة، سترى كلا الخليتين كما هو موضح في لقطة الشاشة هذه.
عينة من الرموز
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Create empty workbook. | |
Workbook wb = new Workbook(); | |
// Access first worksheet. | |
Worksheet ws = wb.Worksheets[0]; | |
// Put some integer values in cell A1 and A2. | |
ws.Cells["A1"].PutValue(10); | |
ws.Cells["A2"].PutValue(30); | |
// Access cell C1 and set its formula. | |
Cell c1 = ws.Cells["C1"]; ; | |
c1.Formula = "=Sum(A1,A2)"; | |
// Add cell C1 into cell watches by name. | |
ws.CellWatches.Add(c1.Name); | |
// Access cell E1 and set its formula. | |
Cell e1 = ws.Cells["E1"]; ; | |
e1.Formula = "=A2*A1"; | |
// Add cell E1 into cell watches by its row and column indices. | |
ws.CellWatches.Add(e1.Row, e1.Column); | |
// Save workbook to output XLSX format. | |
wb.Save("outputAddCellsToMicrosoftExcelFormulaWatchWindow.xlsx", SaveFormat.Xlsx); |