The report has multiple sheets but I only need to pull the file name from cell B6 in the first sheet.
OkâŚ
If itâs always the first sheet, use âGet Workbook Sheetsâ activity and take the first item of the list (index 0)
How do I go about taking the index 0?
Here is my workflow, how do you think that it looks?
Thanks for all of your help so far!
Set a variable in the Output âSheetsâ field (Get Workbook Sheets). Name it as sheetNames.
Then, in the âread rangeâ activity instead of using ââ, use sheetNames(0)
OK, now for my last issueâŚ
In some cases the cell may be blank, I believe this is why I am getting the error pasted below. I tried to handle this with an IF statement but I still get the same error. If the file is blank the name, the file name could remain the same.
I tried using this multiple assign under IF > ELSE and I received the error below. I tried using the multiple assign under IF>THEN and I received and error under the Copy file section. I believe the multiple assign is supposed to be under else.
Multiple Assign: Can not assign âstrSearchConditions.Substring(strSearchConditions.IndexOf(âCust. NM=â)+9, 2)â to âstrCustomerNameâ.
Do you have any suggestions for this issue?
No worries⌠I am here to help you, feel free to share issues youâre facing
Just checkingâŚ
So, you read all cells from B1 to B6. If all of them have a content (different of blank) youâll rename the file. Otherwise, you wonât
Am I correct?
Well, I was trying to read range B1 & B6 but in order to avoid a more complex problem, I then decided to just read cell B6. If content exists the file should be renamed. If content does not exist the file can remain the same.
Got it,
But to rename it, you need other cell values, donât you?
Yes, I am trying to rename the cells based on data within cell B6
Example: Cell B6 contains the Customer name > Extract Customer name > Rename file for Customer Name
Got itâŚ
So, when you used Read Range activity you set an output variable, letâs say cellValue.
After that, use an if activity. If itâs not empty it follows to assign and copy file. Otherwise, it doesnât do anything.
IMPORTANT NOTE: I used cellValue(0)(0) because in your Read Range activity you informed only one cell
I received the same error using this workflow
Multiple Assign: Can not assign âstrSearchConditions.Substring(strSearchConditions.IndexOf(âCust. NM=â)+9, 2)â to âstrCustomerNameâ.
OkayâŚ
Replace sheetNames by another variable (the one in output field of Read Range activity)
Also, copy file should be in the âThenâ branch. Just after the assign activity
I receive the same error after updating the. I used âSheetOutputâ as the output variable from the read range activity
Not(String.IsNullOrEmpty(SheetOutput(0)(0).toString))
Okay,
Now, probably is something related to the manipulation youâre doing.
Share more details about the values youâre trying to attribute in the assign activity.
Also, share a sample of the content in cell B6
I am also using a multiple assign activity, I record 2 values from cell B6 and then rename the file with those two values.
strCustomerName = strSearchConditions.Substring(strSearchConditions.IndexOf(âCust. NM=â)+9, 2)
strAffiliate = strSearchConditions.Substring(strSearchConditions.IndexOf(âS.Affi=â)+7, 2)
strCustomerFilename = âC File locationâ + strReportType + â" + strCustomerName + "â + strAffiliate + â.xlsmâ
Whatâs the value of strSearchConditions? Shouldnât you use âSheetOutputâ?
What about strReportType?
I was able to connect with Gustavo who helped me solve my complex issue quickly. Thank you for the support.
Hi @MF.RPA,
Thanks and Iâm glad it helped you.
Kindly mark one of my answers as solution (it isnât the like button, itâs the green check icon)
Have a good day