I have a working automation that;
- Loops through .csv files in Folder1 … For Each “item” in “Directory.GetFiles([Folder1])”
- Copy File from a “[Source .xslx file]” which is saved in Folder2, makes the copies to “[Folder3]”
- Read CSV [item.tostring] output [DataRange]
- Excel Application Scope “[the newly created .xlsx file which lives in in Folder3]”
- Write Range [DataRange] into “[the newly created .xlsx file which lives in in Folder3]”
The process will therefore take the template file in Folder2, and ForEach file in Folder1, create a copy of the Template in Fodler3 and dump the Folder1 data into it.
Now… As this automation need to executed roughly 300 files each time it is run, I have looked at speeding this process up with a parallel, however I get this error;
ERROR Validation Error Compiler error(s) encountered processing expression “Directory.GetFiles([Folder1])”
Option Strict On disallows implicit conversions from ‘1-dimensional array of String’ to ‘System.Collections.Generic.IEnumerable(Of Integer)’.
Could somebody please advise what argument is needed to enable a parallel run on directory files? As far as I can see, there should be no parallel execution issues as no file is open/needed by the same process, however the variable names used during the loop with be similar.
I have never used a parallel before so appreciate any guidance!