We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Insert Row and copy Format and Formula in XLSIO

I have write to function perform insert Row:

Sub InsertRow()
Dim Rng, n As Long, k As Long
Application.ScreenUpdating = False
Rng = InputBox("Enter number of rows required.")
If Rng = "" Then Exit Sub
Range(ActiveCell, ActiveCell.Offset(Val(Rng) - 1, 0)).EntireRow.Insert
'need To know how many formulas To copy down.
'Assumesfrom A over To last entry In row.
k = ActiveCell.Offset(-1, 0).Row
n = Cells(k, 256).End(xlToLeft).Column
Range(Cells(k, 1), Cells(k + Val(Rng), n)).FillDown
End Sub


But when I want change to XLSIO then I can't find method ActiveCell

Help me



1 Reply

LR Lokesh R Syncfusion Team September 2, 2011 11:37 AM UTC

Hi Hung,

Thank you very much for your interest on Syncfusion products.

Yes, In XlsIO we have property to get the active cell in the active window (the window on top) or in the specified window. Please make use of the below code snippet and let us know if this helps you. Also we have provided the online documentation link for the same.

[C#]

ExcelEngine engine = new ExcelEngine())
IApplication app = engine.Excel;
IWorkbook book = app.Workbooks.Open(@"../../Data.xlsx");
Console.WriteLine(app.ActiveCell.AddressLocal);

Online documentation link:

http://help.syncfusion.com/ug_93/Reporting/XlsIO/ASP.NET/index.htm

Please let us know if you need any clarifications.

Thanks,
Lokesh.



Loader.
Live Chat Icon For mobile
Up arrow icon