Hi KBP,
Below is the change you will need to do to get the Table into collection wherever it is moved.
- Make a duplicate copy of the 'Get Worksheet as Collection' tab and rename it as 'Get Worksheet
Table as Collection'
- Comment or Delete these 2 lines from the Code stage
'ws.UsedRange.Select()
'ws.UsedRange.Copy()
- Replace them with the below lines
ws.Range(TableNameWithHeaders).Select()
ws.Range(TableNameWithHeaders).Copy()
- Save this new Object, Reset and Refresh.
- From the Process (instead of start and end cell) you will now be passing a parameter as "MyTable[#All]"
where MyTable is the name of the table and #All is to copy along with Headers of that table so that the collection column names will be the same as the Headers
- Accept this new parameter in the Start stage of the new Object that you just created ('Get Worksheet Table as Collection'). Just like other parameters pass this parameter to the Code stage by the name TableNameWithHeaders as Text datatype because we are using this name in the code stage.
This change is now a customised one and will work for any table name when you pass it from the process in the format as "TableName[#All]".
Input 1:
Output 1:
After changing the location of the table and also after deleting some rows of that table-
Input 2: Table shifted to Column I and rows deleted
Output2:
The instructions above are long but the change is actually a small one. Let me know if you face any issues.