I am having an issue calling a function into the main script whilst maintaining the excel context
async function main(context: Excel.RequestContext){
findMD(1)
}
The function findMD(test)
contains various ranges which draw from context.workbook
and due to the function being defined outside of main
I'm getting a cannot find name 'context'
error.
To try and solve this I changed function findMD(test){
to async function findMD(context: Excel.RequestContext,test){
. However whilst it has solved the context errors I can still not run the script because the function call findMD(1)
is now getting an error message of Expected 2 arguments but got 1
Would seriously appreciate any assistance one could offer as this is killing me! Thanks!