All variable (ProdMail,InputFolder,OutputFolder,ShareInbox) have valid values in them . As I mentioned earlier, The below line is giving an error and before that line all variables store correct values

Set SubFolder = ShareInbox.Folders(InputFolder) 'Change this line to specify folder