@Dvorský Jan - Directly accessing AAD or MS Graph from withing Office Scripts is not supported yet. What you have described sounds like a very powerful scenario/capability. Please feel free to share your ideas here: https://feedbackportal.microsoft.com/feedback/forum/c23f3b77-f01b-ec11-b6e7-0022481f8472 (or upvote one if it already exists).
At the same time, you can probably try exploring Power Automate Desktop (or Power Automate Cloud) that can integrate and automate Excel along with other web services (like AAD and MS Graph, etc.).