API usage电子表格 APIApiMethodsGetSelection本页总览GetSelectionAsk a question 返回表示所选范围的对象。 语法 expression.GetSelection(); expression - 表示 Api 类的变量。 参数 此方法没有任何参数。 返回值 ApiRange 示例 此示例演示如何获取表示所选范围的对象。 CodeResultPlayground// How to get selected range object.// Update the value of the selected range.let worksheet = Api.GetActiveSheet();Api.GetSelection().SetValue("selected");