I successfully called my First Microsoft Excel API from a custom function thanks to this link Call Microsft Excel APIs from a custom function. However, I am trying to add the VLOOKUP built-in Excel function inside of my custom function. After attempting multiple things for the my code to work, I still am getting a #VALUE! in the cell. What is my code missing? I know this is brand new to production as of 5/11 so is this feature not available yet?
/**
* @customfunction
* @param firstName person's first name
**/
export async function getRangeValue (firstName: string) {
let lastName;
let context = new Excel.RequestContext();
const range = context.workbook.worksheets.getActiveWorksheet().getRange("A1:C5");
range.load();
await context.sync();
lastName = context.workbook.functions.vlookup(firstName, range, 3, false);
lastName.load('value');
await context.sync();
return lastName.value;
}
=CONTOSOSHARE.GETRANGEVALUE("Happy")
