Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells for Python via .NET allows you to set the margins of any shape or comment using the Shape.text_body.text_alignment property. This property returns the object of ShapeTextAlignment class which has different properties e.g. top_margin_pt, left_margin_pt, bottom_margin_pt, right_margin_pt, etc. that can be used to set the top, left, bottom and right margins.
Please see the following sample code. It loads the sample Excel file that contains two shapes. The code accesses the shapes one by one and sets their top, left, bottom and right margins. Please see the output Excel file generated by the code and screenshot showing the effect of the code on the output Excel file.

Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.