Command command = null;
try
{
command = this.applicationObject.Commands.Item(CommandName, -1);
}
catch { }
in C# this is throwin an exception "Value does not fall within the expected range."
I checked that the CommandName is correct and its the same as the name the command gets when it is added so Im assuming that the -1 is the issue.
It is required to be an int and the Microsoft docs say to pass -1.
Any sugguestions to get rid of these exceptions