Please refer to the following Microsoft Learning to programmatically change/set the sensitivity label of a excel document using C#.
Quickstart: Set and get a sensitivity label (C#)
As for the question set the sensitivity label while creating an Excel document from a byte array, it seems that it is currently not supported by using above method.
Best Regards,
Jack
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.