Skip to main content

Posts

Showing posts with the label VBA

Excel Automation Using UiPath

You can do Excel Automation in UiPath in four different ways: Using UiPath Activities. Using LinQ. Using Macros (VBA). Using Excel as a Database. Lets go with one by one : Using UiPath Activities Excel Application Scope: In this You can use Read Range Activity to read all the data into the DataTable. You can use the Read Cell Activity to read the data one by one into the Generic Format. You can use Loops on your DataTable. You can Filter DataTable Activity to filter out your data. Workbook: Even if excel is not installed in your system, then also you can use these activities to read or write excel. Using  LINQ You can use LinQ queries to Filter out the data directly on DataTable or List. In this case you cannot use Read Cell Activity. Read More About LinQ from here: Click here LinQ Syntax . LinQ Queries Used for Filter Out the Data . Using Macros (VBA) You can use macros also, not for Excel but you can do any type of work from Macros. VBA code is easy like a E...

Find the Last Row, Column, in Excel using VBA

It will help you to find out last row count, column count then you can easily loop through your data according to requirement. Let's suppose your Excel contains blank cells then there is a different Code for that, you can easily use this in Visual Basic of Excel and Execute that in UiPath using activity Execute Macro. ***LastRow**** Range("A1").Select / Cells(1,1).Select lastrow = Range(Selection, ActiveCell.End(xlDown)).Rows.Count lastrow = ActiveSheet.UsedRange.Rows.Count ***LastColumn*** Range("A1").Select / Cells(1,1).Select lastcol = Range(ActiveCell.End(xlToRight), Selection).Columns.Count lastcol = ActiveSheet.UsedRange.Columns.Count ***LastRow With Spaces*** xIndex = Application.ActiveCell.Column xRowIndex = Application.ActiveSheet.Cells(Rows.Count, xIndex).End(xlUp).Row Range(Cells(1, xIndex), Cells(xRowIndex, xIndex)).Select lastrow = Selection.Count ***LastCol With Spaces*** xIndex = Application.ActiveCell.Row xCol...