Enter data respect to column name

excel

#1

Hi @aksh1yadav @arivu96 @dominic ,

Need your support to solve this issue, i have tried a lot :frowning:

Ref my screenshots and discussions with Mr.Steve.

I have concern, My process flow is below :

  1. Open Excel-01 and read few cells and stored it as Variable
    2.Open Excel-02 and apply filter - Do filter by using saved variable
    3.End of Filter you will have only one row - Compare qty column from Excel 1 and Excel - 2
    4.If both the qty is matching i need write one of saved variable in column name " OLS AVAIL ID"

i can able to do step 1 to 3 but step 4 is not working for me, i tried to put message box its correctly reading the data in the respective cell but when i use write cell its not working.

Can someone help me to solve this concern.

Regards,
Lawrance A


#2

Hello @Lawrance_A,

It’s normally a good idea to post your .xaml file (and the excel files that your program uses), when asking about specific questions like this. It makes it much easier for us to try and help you.

Cheers.


#3

Hi Steve,

i have attached my Xaml file and i need to enter data in Column Q in attached Excel file if the criteria matches.

Hope this will help you to understand better

OD_020818 - Copy.xlsx (543.3 KB)

Data Validation_V1.0.xaml (47.2 KB)


#4

If you want to compare that the value in valQty is the same as filter2.Rows(0)(“QTY”).ToString you first need to change your valQty from Generic Type to String.

When you’ve done that, you can do valQty.Equals(filter2.Rows(0)(“QTY”).ToString)

There are also the options valQty.StartsWith or valQty.Contains that you can use, if you are not certain of the exact text within the cell.


#5

HI Steve,

My concern is after comparing the data if qty matches i need to enter variable (valSLINum) into column Q of Excel file.


#6

I need guidance how to enter valSLINum variable in excel file


#7

And a Write Cell activity with valSLINum.ToString does not work?


#8

what could be the syntax for cell range ?

image


#9

You told me that it is “Q”+ DataTable.Rows.IndexOf(row)+2 (the +2 may vary whether or not that you have included headers or not)


#10

This looks promising, i will try this


#11

I am getting this error.


#12

Could you send me the corrected xaml file? It seems like you have double quotes in there, you should only have quotes around Q


#13

HI Steve,

Find the corrected xaml file, i tried with single quote but am getting below error.

Data Validation_V1.0.xaml (47.5 KB)


#14

Try to copy paste this line inside the field instead:

“Q”+filter2.Rows.IndexOf(row)+2


#15

Same error exists…

image


#16

Try to put the +2 inside the parentheses, you might start getting some off-by-some errors, try adjusting the +x part.


#17

Hi Steve,

Tried with parentheses also same error exists.


#18

Hi Steve,

I could able to find the mistake but not solution :slight_smile:

When i tried with different sheet in same excel workbook its working i tried to Write cell in Sheet3 A2 its working but if i change it to Sheet2 there is a above error.

Any idea why this kind of error ?