Get Visible Text -> Write Data to Datatable

Try just replacing “New String() {Environment.NewLine}” with the constant VbCrLf.

1 Like

I was able to get the list to work after incrementing the index outside of the if statement.

I am now getting an error stating that the Index and length must refer to a location within the string parameter length.

String: "currentItem.Trim().Substring(0,2)

Use debug to see the value of currentItem. That error means that the string is not 2 characters long. It’s probably empty.

@MF.RPA

Can you tell what you are getting as each item in current item?

Also splitting on space might give. Empty value as well if there is a space at the start

Cheers

It looks like I am getting a long line of spaces for the final current item value.

@MF.RPA

Better use a trim before the initial split only sot hat any spaces at start or end are removed

Cheers

1 Like

Trim the whole thing before you split it.

1 Like

@Anil_G @postwick

Trimming before splitting solved my problem.

Thank you guys!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.