How to fix "StringConverter cannot convert from System.Double." in In\\UiPath - excel

When I make the "Read Cell" in "Excel application scope", I tried to output the read data from Excel by using "Write Line". However, It's not working and it ouput the error as in the Title. Could you someone make it up?

I had the same issue. I'm using the LookupDataTable activity. In my Excel file I have a mix of Strings and Integers. But somehow I also got the error:
NotSupportedException: StringConverter cannot convert from
System.Double.
I solved it by changing the variable from String to GenericValue.
I also tried to give it the Double type, but it didn't work because I think I have different types in the column.

Try this maybe be it will help you to check out
Convert.todouble

Related

Corverting to Integer in Power Automate

I was searching for solution one by another and still have some problems, i am open to change even a whole schema, but i have time till weekend. If you have new solution show me, if i did something wrong please tell me.
This is where it happens
Also earlier i had problem with just initializing variable and puting there value from excel, but now i guess i am on right way. Earlier program told me that i am setting string to my int variable.
Yep, so i did that but still i receive:
InvalidTemplate. Unable to process template language expressions in
action 'var_name' inputs at line '0' and column '0': 'The template
language function 'int' was invoked with a parameter that is not
valid. The value cannot be converted to the target type.'.
I don't know what it meens and what to do, what i know is that i can still see and show what i got from my excel, also in excel file every cell i get is set to be Integer.
Can someone help me? I can show You more if its necessary.
I changed type of cells to intiger in my excel, also i made this function, and still none. Help, i do not have time and i worked on it for too long.

Excel VBA objsnmp.set strange things

I use the objSNMP.get method in Excel VBA without any problems.
I'd like to use the objSNMP.set method, but unfortunately it's not that easy. According to the website, it should work similarly to get, with the difference that there is one more parameter: the value to be sent.
If I try the official way:
objSNMP.Set ("43.18.1.1.2", OIDValue)
Image1
I get the message "Compile error: Syntax error".
I found another solution that works conditionally. Namely as follows (it can be seen commented out in the picture):
randomVarName = objSNMP.Set("OID", Value)
For example:
temp = objSNMP.Set(".1.3.6.1.4.1.9.9.68.1.2.2.1.2." & PortNum, 21)
In this case, the code runs without error. This is interesting because I haven't found any official information about this anywhere. Somewhere deep in the recesses of the internet, I only found this possible solution some time ago.
If, on the other hand, I do not enter the value directly, but write the name of a variable there (e.g. VLANNum),
temp = objSNMP.Set(".1.3.6.1.4.1.9.9.68.1.2.2.1.2." & PortNum, VLANNum)
I receive an error message. Image2
It doesn't matter if the type of the variable is not declared, string or integer. I also tried several different cell types in Excel, but nothing changed.
The error message is:
Run-time error '-2147467259 (80004005)':
The requested SNMP operation attempted to modify a variable, but
either a syntax or value error occurred.
Based on the above, I cannot insert the value read from the excel table at the end of the "objSNMP.Set" method in such a way that it can send the value. I could only solve the task if I create 4094 different "objSNMP.Set" lines and select what is necessary from among them. Not very efficient.
I have the solution. The value transferred with the variable works in the following form:
objSNMP.Set ".1.3.6.1.2.1.2.2.1.7.9", CInt(x)
Where x is the variable.

Calling a template variable from an output modifier in Modx?

I'm trying to output a template variable inside the if statement in ModX, but it gives no output.
I have multiple pages with links to articles and the point is to only output template variable content on the first page but not the others.
// This gives no output:
[[!#get.page:is=`1`:or:is=``:then=`[[*content]]`:else=``]
// This outputs "yes" on the first page and "no" on others:
[[!#get.page:is=`1`:or:is=``:then=`yes`:else=`no`]]
I've even tried this, but it still does not give any output. I guess the problem is not about the output modifier:
[[!#get.page:is=`1`:or:is=``:then=`[[*content]]`:else=`[[*content]]`]
I'm using ModX Revo 2.7.0
Any help is appreciated, thanks in advance!
Actually in your case missing a double closing angle bracket "]]"
[[!#get.page:is=`1`:or:is=``:then=`[[*content]]`:else=``]]
The `or:is=` is matching against an empty state. Unless that is intentional you should be able to remove it. Also, the `:else=`` is the default state, so, you don't need that either.
The following should work and you'll have cleaner code:
[[!#get.page:is=`1`:then=`[[*content]]`]]

Excel-VBA: is there a VBA command that reads it's own line number

My Excel 2016 VBA code has rare occasions of fatal errors (e.g. loss of variable or reference values).
It sends mail/text then.
I'm looking for a way to state in which module and code line the problem occurred.
Is there a VBA command that can read the module name and the line number?
...without hard-coding the module and function/sub name.
You can use Erl as long as you have added line numbers to the code.
My idea of best case scenario for emailing fatal errors:
Save all the user's input in a class variable. In case of error, mail the information to yourself plus the type of the error.
This should be enough to replicate and fix.
Concerning a way to get the module name without hardcoding - there is no such way. But using a hardcoded variable for the name is not that difficult - http://www.cpearson.com/excel/InsertProcedureNames.aspx

VB6 Read String From Resource

I have text file in VB6 Application resources, and I am trying to read the text in it.
How to do that? I have been searching for hours without a proper solution. Somebody please help me.
My code is:
Private Sub Command1_Click()
Dim URL As String
URL = LoadResString(101)
MsgBox URL
End Sub
This maybe explains it more: http://i.imgur.com/wGnWCBb.jpg
Is this even possible? Somebody please spoonfeed me, I would appreciate that a lot.
I am trying to read the string from resource to a variable(string) and then prompt it with messagebox.
Some simple solution would be great. Also, if this is possible with FindResource API, please tell me how or point me to the right direction.
I had to do something like this many years ago.
I used s = StrConv(LoadResData(resId, resType), vbUnicode). The resource was an ANSI (non-unicode) file.
resType was a custom type I just made up when I saved the resource.
I had an issue with a double null that got appended at the end of the text, and which had to be removed. I can't remember the exact reason why that happens, but I presume it has to do with the resource being stored as a double-null-terminated list of C-strings.
If I had to guess, you'll have better luck with LoadResData(). Make sure to use both parameters (the id and type ones).

Resources