Hi I need to Execute following Code, Please guide me
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range
' Start Excel and get Application object.
oXL = CreateObject("Excel.Application")
oXL.Visible = True
I have written this code how can i make it work using invoke code activity please help
Private index1 As Integer = New StringHelper().GetIndexofSearchText("C:\Users\vivekver\Documents\UiPath\Nokia Automation\Configuration Manager Nokia 2nd\TEST.txt", "MRBTS-486203")
Private index2 As Integer = New StringHelper().GetIndexofSearchText("C:\Users\vivekver\Documents\UiPath\Nokia Automation\Configuration Manager Nokia 2nd\TEST.txt", "[TopologyNode: PLMN-PLMN/MRBTS-486215]")
Public index_Hotkey As Integer = New NoOfHotkeys().GetHotkey(index1, index2)
Public Class NoOfHotkeys
Public Function GetHotkey(ByVal index1 As Int32, ByVal index2 As Int32)
Dim index_Hotkey As Integer = index2 - index1
Public Class StringHelper
Public Function GetIndexofSearchText(ByVal Filename As String, ByVal SearchText As String) As Integer
Dim index As Integer = 0
Dim lines As List(Of String) = File.ReadLines(Filename).ToList()
For Each line In lines
If line.Contains(SearchText) Then
index += 1
i want index_Hotkey as output to my uipath workflow.Please help
i am new to uipath and i am trying to use the invoke code activity to work on excel for that i have imported Microsoft.office.interop.excell through import tab in uipath studio but still gettting error for Excel.
could you pleae guide me how to use the external dll in invoke code.
May be. Because we have to see how we are writing the code. And it accepts VB.Net.
The activities has been handled object well. I am not sure that we can able to do all the things in the Invoke code.
I read the invoke code will get slow . I have seen a post the below.
Some situation we can not avoid the Invoke code activity …
Thats y I said may be. Depends upon the situation. But the time study is good one when we go with the performance. And if you have an activity for example to Open browser. you can use it. Unnecessarily why you are using invoke code. It takes your time also, But really I like these conversation in the form.
Dear all, I would like to enter a VB.Net code to change my windows password. Any experiences for doing so? I have tried:
Dim res As NET_API_STATUS = NetUserChangePassword(Environment.UserDomainName, Environment.UserName, oldPass, newPass)
If res <> NET_API_STATUS.NERR_Success Then
Throw New ApplicationException(“Error setting password - Error code:” &res.ToString())
However, I am getting the following error:
Error compeling code:
Error BC30002 Type: NET_API_STATUS is not defined. At line 1 Error BC30451: NET_API_STATUS is not declared. It might be due to its protection level at line 2.
What issue are you running into when you try to just copy + paste into an invoke code activity?
Also, why are you using invoke code for this? This is a relatively simple piece of code and I dont think I understand what the advantage would be for using invoke code? It could be done using a few assign activities instead which would be quicker and easier for others to understand.
I am not 100% sure what @dilini2004 is trying to do, but it looks to me like they’re trying to determine what week of the month a given date is using a fairly simple function
If my assumptions above are correct, you could just do the following in a standalone sequence to be used as a library or standalone workflow. In argument = a datetime i’ll call in_GivenDate. Out Argument = An integer i’ll call out_WeekOfMonth. Import the System.Globalization namespace
Assign first (datetime variable) = new Datetime(in_GivenDate.Year,in_GivenDate.Month,1)
Assign MyCalendar = DateTimeFormatInfo.CurrentInfo.Calendar
Assign out_WeekOfMonth = MyCalendar.GetWeekOfYear(in_GivenDate,CalendarWeekRule.FirstDay,DayOfWeek.Sunday) - MyCalendar.GetWeekOfYear(first,Calendar.WeekRule.FirstDay,DayofWeek.Sunday) + 1
This accomplishes the same thing in just 3 simple assign activities. Of course I would probably turn it into 5 assign activities for readability (create 2 more integer variables for the .GetWeekOfYear integers), but it’s still quite simple and is much preferred over using the invoke code