Skip to main content

Posts

Showing posts from May, 2021

Excel Formatting Using Vb.Net Code | UiPath

To do excel formatting, there is no specific activities available in UiPath, so either you have to go for VBA or Vb.Net to get the required formatting. Both methods are good and fast. Lets see how we can write a simple code to do our formatting. First of all, if you are using this  Microsoft.Office.Interop.Excel in UiPath , then there are chances that it will show you error, so you have to install this. First to go to Manage Packages and install this: If still shows error then open your .xaml file in Notepad and paste this below line along with another assemblies present in file: Now you are ready to use below Code, Use Invoke Code activity and paste this entire code into that and run. FullFilePath,  SheetName----  Replace these with your File Path and Sheet Name, you can also make them as Argument and use that variable in place of this. '--------------Code------------------ Dim excel As Microsoft.Office.Interop.Excel.Application Dim wb As Microsoft.Office.Interop.Ex...

Kill User Specific Process | UiPath | Automation

As you already have seen the situation where multiple users are logged in on single VDI. On this situation when we use Kill Activity directly to kill the process forcefully then it kills all processes without checking the user details. So we are writing small code so which you can use in your KillAllProcess workflow of Re-framework. It will kill processes for logged in users and plays a vital role when running Bots in High Density Environment on Servers or standalone systems. It works as per below: It will get the process session Id as Process_Username. It will get the current user session Id as Current_user. Then Check the If condition that Process Name is Equals to your Input process Name and Process_Username=Current_user Then it will pass process variable into the Kill Activity to kill that process. 1. Get Processes Activity , Output Variable: ActiveProcesses 2. Use For Each Loop and Pass the Above variable inside it and make the TypeArgument as System.Diagnostic.Process 3. Insi...