As per Dell OptiPlex 7040 SFF, the expansion slot PCI-E can support only 1 half height PCIe x16 ! while TP-LINK Archer T6E is Full Height/Full Length card type!
So this WIFI card won’t fit on this PC! The type of compatible WIFI card for this PC would be a PCI-E card without metal frame and with separate antenna where you can install it externally and fix it on the outer body of the PC.
I hope this would help you, if more Info required Pls let me know. Regards, dubiz