Troubles when flashing Optiplex 7040m with CH341

Well not all hardware boards Intel 100 series are sucessuful in to “CoffeLake mod” specailly non-regular motherboards as yours.
I do suggest to read the follwing threads/guides:
[Guide] CoffeeLake CPUs on Skylake and KabyLake mainboards - BIOS/UEFI Modding / BIOS Modding Guides and Problems - Win-Raid Forum

[Guide] Fixing HT for Coffee Lake CPUs on Z170/270 Chipset MBs - BIOS/UEFI Modding / BIOS Modding Guides and Problems - Win-Raid Forum

[Tool] Easy automated Mod tool for Coffee Lake bios - BIOS/UEFI Modding / BIOS Modding/Flashing Tools - Win-Raid Forum

EDIT: I am almost sure, not betting at all… that you won’t find such board/system as a 7040M with a successful CoffeLake mod…that’s why i linked the threads.
You will see “regular” desktops boards Asus, MSI etc…

So 7th Gen only…? Does the bios at least has the right mcodes?
There’s successful reports of some Veriton N4650G (or 40G…not sure) mod to 7Th Gen…its in the forum…around some where, try to find it and ask gudinace to some users on that thread.