using System; using Aspose.Cells; using Aspose.Cells.Drawing; class Program { static void Main(string[] args) // Add line in Excel using C# { new License().SetLicense("License.lic"); // Create a workbook Workbook book = new Workbook(); // Select a sheet Worksheet worksheet = book.Worksheets[0]; // Draw line ShapeCollection shapes = worksheet.Shapes; shapes.AddLine(3, 5, 3, 5, 100, 500); // Save the output book.Save("sample.xlsx", SaveFormat.Xlsx); Console.WriteLine("Lines added successfully"); } }