Hi Everyone. I am getting the following error: "Cannot identify the object "[ WebEdit ]" (of class WebEdit). Verify that this object's properties match an object currently displayed in your application."
This code works perfectly fine EXCEPT when webeditname = some value with parenthesis in them. For Ex: Key_Name_(Last)_1
This code is able to identify that the object's name exists in the spreadsheet (1st row), in this case Key_Name_(Last)_1, however, when it enters the IF statement and tries to .Set the value taken from the spreadsheet (2nd row) I get the error. Any ideas??
The piece of code I'm having trouble with is below:
please disregard the two lines as i was trying different solutions and forgot to edit them out. thanks.
Trim(webeditname)
webeditname = Trim(webeditname)
This code works perfectly fine EXCEPT when webeditname = some value with parenthesis in them. For Ex: Key_Name_(Last)_1
This code is able to identify that the object's name exists in the spreadsheet (1st row), in this case Key_Name_(Last)_1, however, when it enters the IF statement and tries to .Set the value taken from the spreadsheet (2nd row) I get the error. Any ideas??
The piece of code I'm having trouble with is below:
Code:
For i = startpoint To co.Count-1
If LCase(Trim(co(i).GetROProperty("micclass"))) = LCase(Trim("webedit")) And LCase(Trim(co(i).GetROProperty("type"))) = LCase(Trim("text")) Then
For n = 1 To totalcol
If LCase(Trim(co(i).GetROProperty("name"))) = LCase(Trim(spsh.Worksheets(1).Cells(1, n).Value)) Then
webeditname = spsh.Worksheets(1).Cells(1, n).Value
Trim(webeditname)
webeditname = Trim(webeditname)
webeditvalue = spsh.Worksheets(1).Cells(2, n).Value
'MsgBox webeditname
'MsgBox webeditvalue
Window("APP").Window("eForm").Page("title:=" & pagename).WebEdit("name:=" & webeditname).Set webeditvalue
Exit For
End If
Next
End If
please disregard the two lines as i was trying different solutions and forgot to edit them out. thanks.
Trim(webeditname)
webeditname = Trim(webeditname)