I'm trying to automate some different Excel files with a start macro, where the additionals parameters are stored in a job CSV file atm.
The problem is how to build the run command for Excel where you run the macro, with parameters like this, where "Start" is the name of the macro and in this example 3 additional parameters.
$excel.Run("Start","param1","param2","param3")
I have tried building the command and parameters as a string like I would if it was a normal cmd-let, and then invoke-expression, but the run command just read it as one string.
So how do I build the Run command with a dynamic number of parameters, without building some kind of switch that handles lets say 1-5 different parameters. that all calls $excel.run command with different amount of parameters, that's just a bit ugly and not very dynamic.