如何在我的 Excel 电子表格中调用它?Rick 在下面用下面的代码帮助了我,但是我怎么称呼它呢?我正在尝试 VLOOKUP numOfParts(在参数中询问)并返回 finalInspectionPerPart。
async function inspectionMins(numOfParts) {
try {
let finalInspectionPerPart;
const procEff = 0.72;
await Excel.run(async function (context) {
const range = context.workbook.worksheets.getItem("Sheet1").getRange("A1:B9");
finalInspectionPerPart = context.workbook.functions.vlookup(numOfParts, range, 2, false);
finalInspectionPerPart.load('value');
await context.sync();
return (finalInspectionPerPart.value / procEff);
})
} catch (error) {
// handle error
};
}