Skip to main content

Posts

Showing posts from February, 2019

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...

Deleting IE Temporary files, Cookies, History, Closing Browsers

Sometimes all you have to do run this Macro code to clear everything. Then I find this Macro VBA code very helpful as your process always starts from the beginning. You can add this Code in Excel Visual Basic Section and Execute in UiPath using Execute Macro Activity. It will take a few seconds and you are good to go then. It will Delete following from Browsers:  Sub DeleteFiles() Application.DisplayAlerts = False Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255" ' (Deletes ALL History) Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1" ' (Deletes History Only)" Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2" ' (Deletes Cookies Only)" Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8" ' (Deletes Temporary Internet Files Only)" Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16" ' (Deletes Form Data Only)" Shell "RunDll32.exe InetCpl.cp...

Custom Date and Time Format Strings Used in UiPath

A custom format string consists of one or more custom date and time format specifiers. Any string that is not a standard date and time format string is interpreted as a custom date and time format string. In this, we will cover some formats to COnvert the Date and Time from Different Formats to our format. This is a variable, I am using "vDatVariable= Generic". Convert.ToDateTime(vDatVariable.toString).toString("dd MMM yyyy") Now.toString("dd MM yyyy") First Format: The Date you are fetching, coming in this format Second Format: The format you want. DateTime.ParseExact(vDatVariable.ToString,"dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy") DateTime.ParseExact(vDatVariable.ToString,"dd-MMM-yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo,Globalization.DateTimeStyles.None).ToString("MM/dd/yyyy") For More Info Refer this Link: Click here...