1.将二维数数组json字符串写入单元格里,如:[["a1","a2"],["a3","a5"],["a9","a1"],["a5","a7"],["a2","a2"]]
2.将函数公式写入单元格里并自动扩展, 如:=SEQUENCE(10) ={"a1","a2";"a3","a4";"a5","a6"}
1.c#代码将二维数数组json字符串写入单元格里
//.cs 文件类型,便于外部编辑时使用
// 引用必要的命名空间
using Excel = Microsoft.Office.Interop.Excel;
public static void Exec(Quicker.Public.IStepContext context)
{
var gg = context.GetVarValue("json数组") as string[,]; // 读取动作里的变量值
Excel.Application excelApp = (Excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application");
Excel.Range range1 = excelApp.ActiveCell as Excel.Range;
int i=gg.GetLength(0);
int j=gg.GetLength(1);
range1.Resize[i, j].Value2 =gg;
}
2.c#代码将函数公式写入单元格里并自动扩展
//.cs 文件类型,便于外部编辑时使用
// 引用必要的命名空间
using Excel = Microsoft.Office.Interop.Excel;
public static void Exec(Quicker.Public.IStepContext context)
{
var gg = context.GetVarValue("函数gs") as string; // 读取动作里的变量值
Excel.Application excelApp = (Excel.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application");
Excel.Range range1 = excelApp.ActiveCell as Excel.Range;
range1.Formula = gg;
range1.Replace("@", "");
}