I’m having trouble havnig the correct value selected when using a nested “For Each Row in Excel”. The file uses each name in the list to save the files correctly but then uses the following value in the list to copy paste. Can anyone look to see how i might resolve? thanks!
You don’t copy/paste to put data into Excel. Use the Excel activities.
Sorry here is the current process. I am using the activities. 1.1 Single Excel Process Scope (SequenceX)
Private = False
Variables
Notes(IWorkbookQuickHandle)
Saved(BindingsRepository)
Activities
1.4 Use Excel File (ExcelApplicationCard)
Workbook path = string.Format(“{0}\OneDrive - Hearst\PM 2022 Content Budget Template (DOMO).xlsm”, Environment.GetFolderPath(Environment.SpecialFolder.UserProfile))
Create if not exists = True
Save changes = True
Read-only = False
Private = False
Body
1.5 Do (Sequence)
Private = False
Activities
1.6 For Each Excel Row (ExcelForEachRowX)
In range = Excel.Table(“Brands”)
Has headers = True
Empty row behavior = Stop
Save after each row = False
Private = False
Body
1.7 Do (Sequence)
Private = False
Activities
1.19 Read Cell Value (ReadCellValueX)
Cell = Excel.Sheet(“PM Forecast”).Cell(“C19”)
Get formatted text = False
Save to = Saved.Values(Of UiPath.Excel.ExcelValue)(“PMNumber”)
Private = False
1.14 Copy/Paste Range (CopyPasteRangeX)
Source range = CurrentRow
Destination = Excel.Sheet(“PM Forecast”).Range(“‘PM Forecast’!BrandSelection”)
What to copy = Values
Exclude source headers = False
Transpose = False
Private = False
1.8 Save Excel File As (SaveExcelFileAsX)
Workbook = Excel
Save as type = MacroEnabledWorkbook
Save as file = string.Format(“PM-{0} {1}”, Saved.Values(Of UiPath.Excel.ExcelValue)(“PMNumber”), CurrentRow.ByField(“Brands”))
Replace existing = True
Private = False
hey
can you share an example on what do you need please?
regards
The copy paste value from the list “Current Row” in excel “Brands” is below the one that is being picked up for the Save As. I’m trying to get them to use the same one.
For instance, the table in excel that it is using is the following:
Brand
Autoweek
Bicycyling
Cosmopolitan
The process is saving the first file correctly as “PM-3 Autoweek”. However, it is pasting Bicycling into “PM Forecast” instead of “Autoweek”.