Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells for Python through .NET allows you to set the margins of any shape or comment using the Shape.text_body.text_alignment property. This property returns an object of the ShapeTextAlignment class, which has several properties, e.g., top_margin_pt, left_margin_pt, bottom_margin_pt, right_margin_pt, etc., which can be used to set the top, left, bottom, and right margins.
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. View the output Excel file generated by the code and a screenshot showing the effect on the output file.

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