static void Main(string[] args) { if (args.Length < 2 || args.Length > 3) { Console.WriteLine("Usage: excelmacroextractor.exe file targetdir [--copy-xlsm]"); return; } ExcelExtractor excelExtr = new ExcelExtractor(); excelExtr.ExtractMacrosFromXLSM(args[0], args[1]); if (args.Length == 3 && args[2] == "--copy-xlsm") { excelExtr.CopyXLSM(args[0], args[1]); } }