A Managed Software Delivery (MSD) policy for Internet Explorer (IE) 10 or IE 11 succeeds on some computers and fails on others with exit code 40007.
The behavior seems to be random and does not require installing prerequisite updates as suggested by code 40007. Running the installation again on a computer that failed with exit code 40007 will eventually result in a successful install.
Make sure that the Managed Software Delivery (MSD) policy has a working detection rule and give it a repeating schedule to continue retrying the installation on computers that have failed to install the new version of IE. A detection rule always runs before the software installation and will prevent the installation attempt if it finds the computer to already have the software installed.
Instructions on creating a detection rule for Internet Explorer:
Figure 1. An example of a detection rule to detect IE11 based on the file version of iexplore.exe.