Adding an autoshape - specifically a Line in an excel cell

Hi,
I am trying to add a line (it can be added by clicking Insert->Picture->autoshapes->line in an excel worksheet) .
How do i achieve the same using the aspose product?

regards,
Jaideep.

Hi Jaideep,

Please use Aspose.Cells.Shapes and Aspose.Cells.LineShape classes:

Here is the piece of sample code:

//Instantiate a new Workbook.

Workbook workbook = new Workbook();

//Get the first worksheet in the book.

Worksheet worksheet = workbook.Worksheets[0];

//Add a new line to the worksheet.

Aspose.Cells.LineShape line = worksheet.Shapes.AddLine(5, 0,3,0, 5, 300);

line.UpperDeltaX = 200;

line.UpperDeltaY = 200;

line.LowerDeltaX = 200;

line.LowerDeltaY = 200;

//Set the placement.

line.Placement = PlacementType.FreeFloating;

//Save the excel file.

workbook.Save("d:\\test\\tstline.xls");

Thank you.

Amjad,
thanks for the quick response.
I dont happen to see the worksheet.shapes.addline() method in the api.
Is there something i need to add to be able to use that method? is there a seperate build?
this is urgent, i would appreciate if you could reply asap.

thanks in advance,
Jaideep.

Hi Jaideep,

I think you not using the latest fix (4.2.0.11). Please try the attached version.

Thank you.

Amjad,
thanks for the reply.
I did not get to test this, because i received this following error "The subscription included in this license allows free upgrades until 12 May
2007, but this version of the product was released on 27 May 2007. Please renew
the subscription or use a previous version of the product."

I am sure we have a full license of the aspose suite. I work for logixml inc. Please take a look into this.

This message means that your license is expired on 27 May 2007. To use the new version after this date, please renew your subscription.

To test this feature, you can remove your SetLicense method call. It will continue to work except adding the license worksheet in output file.