How to embed excel files in onedrive for business

Highlighted
Occasional Visitor

One drive business is not supporting embedding excel files. but i have a strong requirement to do so. in this example they explain how to do it manually using the classic one drive interface. is there anyway i can do it through coding ?

graph client snippets this is the line to get a share link

Permission permission = await graphClient.Me.Drive.Items[id].CreateLink("view", "organization").Request().PostAsync();

but only view and edit is available. i tried adding " &action=embedview" to the url end but it also not working. anyone have any idea how to achive this ?

and also how to generate the preview link from this

Permission permission = await graphClient.Me.Drive.Items[id].Preview("",100).Request().PostAsync();

this says cannot convert item preview info to permission.

Thank you in advance

0 Replies