How to make an HTML modal window using Javascript and CSS

This is basically an application of this tutorial from w3schools. I've created a fiddle for it and customized mainly the CSS.

Modals are a neat way to present content in an HTML page without making it look cluttered. You can use it to contain information you don't want to be visible at all times. You increase the usability of your website by not having your user jump to a new page for small information or a form.

This is really more of a note to self haha but hope you find is useful too!

[UIPath] How to include default Outlook signature dynamically in Send Outlook Mail Message activity

How nice would it be if UIPath would enhance its Send Outlook Mail Message activity to allow users to include their default email signature?

Something like this...

UIPath wishlist: looking forward to this feature enhancement!

Photo is edited of course hehe but in the meantime that's it's not possible directly, here's a pretty neat workaround I've discovered.
But first, here's the situation. I have a robotic workflow that sends email messages on Outlook, and it's being run by multiple users, depending on who's available. Naturally, the email will be sent from their personal accounts, so the signature must be theirs as well.

I need a way to automatically fetch their signatures as HTML and attach it to the email body. The challenge for different users is that the signature details are different as well, so you have to generate the appropriate ones every time you run the robot.

One way would be to prepare a text file containing a signature template and have them edit the details every time they run the workflow. You can then read this text file and append it to the email body.

But another, more straightforward way is to fetch their signature files directly from Outlook's directory.

Somewhere in your user account's roaming folder is your outlook email signatures. These are the email signatures you've created using your mailbox. In my case, they're stored here:


The folder structure may differ per setup but if you're working with users within the same network or have the same MS Office setup, chances are the path is the same, except for the username of course. And you can get that using the Environment.username variable.

So now that you have the direct path to your Outlook's default email signature, you know the rest. Read it, store it in a text file, and finally append it to your message body. Don't forget to tick IsBodyHtml! :)

Caveat? Images don't work, so there's that.

Hope this helps somehow!

[UIPath] VBA macro for formatting headers in Excel

Here's a neat piece of code I use whenever I needed to apply a macro that formats headers on an Excel workbook. I always come across this step whenever I write a datatable to an Excel file. Datatables are being copied as plain text so you have to format it to make it look more presentable. The goal is to programmatically turn this unformatted workbook...

to a formatted one which is very much readable and ready for reporting:

Here you go:

Private Sub FormatHeaders()
    Dim ws as Worksheet
    For Each ws in Worksheets
        Rows("1:1").Font.Bold = True
        Range(Range("A1"),Range("A1").End(xlToRight)).Interior.Color = RGB(173, 216, 230)
End Sub

What this macro does is loop through all the sheets in the workbook and do the following:
  • Autofit all columns
  • Autofit all rows
  • Bold the headers
  • Add background color to the headers
Then it will focus back on the first sheet.

Now it's easy to read and ready to sent out. Remember to setup MS Excel's trust settings if you're going to run an external macro.

Hope this helps!

[UIPath] Error: Could not connect to UiPath Robot Service. Make sure the service is started!

I'm encountering this error a lot these days, I'm not sure why. But for some reason this error only appears when I'm running a workflow that was created using an older version of UiPath. When I try to run the workflow on Studio, it gives me this message:

As suggested by the prompt, I made sure that the UIRobot service is started. But it still doesn't work. Restarting the service doesn't work either unless it's done in the following order (see below). So here's how I got through this error:

1. Close UiPath Studio
2. Run services.msc (win + R >> services.msc)
3. Look for UiPath Robot service
4. Stop UiPath Robot service (right click >> stop or look for the stop button on the toolbar)
5. Open UiPath Studio and load the workflow you want to run
6. Start UiPath Robot service (right click >> start of look for the start button on the toolbar)
7. Run the workflow on UiPath Studio

That should do it! Hopefully it works for you too :)

[UIPath] How to schedule robotic workflows without Orchestrator

An alternative to UIPath Orchestrator that we've found effective in scheduling robotic processes is Windows built-in Task Scheduler. We got the idea after learning that workflows can be run from the command line.

The concept is simple, first you create a script that starts a robotic process using UIPath robot. Then, you create a new task on Task Scheduler, load that batch file as an Action, and set your desired schedule.

Here's how:
Creating the script file

Open notepad and type the following command:

"C:\Program Files (x86)\UiPath\Studio\UIRobot.exe" 
/file:"C:\Users\Yan\Scripts\UIPath\ExcelTest\ExcelTest.xaml" /executor /monitored
  • Replace the first location with the actual path of your UIPath Robot
  • Replace the second argument with the actual path of your xaml workflow
  • Save the file as a .bat file

Creating the task

Open up Task Scheduler and Create a Task.
  • On the Actions tab, add the script file you created
  • On the Triggers tab, setup the schedule you want for this task
That's it! The general idea is to be able to use Task Scheduler for running scheduled workflows instead of UIPath Orchestrator. I don't know the specifics about setting up a task but we only configured Triggers and Actions tab for this. 


[Windows] How to open multiple apps at once using the run dialog

Basically what I want to do is launch several applications in one command. There are many options to do this. You can create a batch file that opens several applications then run it, or you can simply type a command from the run dialog that launches the apps you want.

I choose to do the latter because it's easier for me.

Here's the syntax. Suppose I want to launch Notepad, Calculator, and Task Manager in one go:

cmd /c start notepad & start calculator & start taskmgr
  • This command basically tells the computer to execute the program followed by the start command. 
  • The & allows you add multiple commands.
  • Remember to use the program's process name in order to launch them properly

[UIPath] Error: Programmatic access to Visual Basic Project is not trusted

If you encounter this error on UIPath saying "Programmatic access to Visual Basic Project is not trusted", it could mean that your MS Excel's Macro Trust Settings is disabled.

By default, Excel blocks any programmatic access to the application unless the user permits it. You may be invoking an external VBA macro file in your UIPath workflow that's causing this error. To enable trust settings, simply do the following:

  1. Open a blank workbook on MS Excel
  2. Got to File >> Options
  3. Click on Trust Center >> Trust Center Settings

  4. Click on Macro Settings >> Check ‘Trust Access to the VBA project object model’ (under Developer Macro Settings)

  5. Click OK to exit Trust Center window >> Then Click OK again to exit Excel Options window
Let me know if it worked! :)