Writing IDocument Variable type data to xlsx file with headers

Hello Everyone,

Could someone help me with how to write “IDocumentData” Variable type to xlsx file including header, Please, in similar way of writing DataTable at once, instead writing each cell with each data point of IDocumentData.

Quick support would be highly appreciated.

Thanks.