So this is working perfect. But I am getting an error when the Onedrive is setup in the business central
So, I tried to debug the issue, at last I got to know that this is because of Onedrive setup. but I am unable to troubleshoot it.
In openExcell line its triggering the error.
So when its trying to get the Default Location, its getting an error
In debugging I got the ResponseErrorDetails
'{"error":{"code":"BadRequest","message":"Current authenticated context is not valid for this request. This occurs when a request is made to an endpoint that requires user sign-in. For example, /me requires a signed-in user. Acquire a token on behalf of a user to make requests to these endpoints. Use the OAuth 2.0 authorization code flow for mobile and native apps and the OAuth 2.0 implicit flow for single-page web apps.","innerError":{"date":"2025-04-21T13:02:48",".........
this is the call stack
Can anyone help me or any suggestions , how can we troubleshoot this issue.