Make sure you're using the vSphere Web Client to do this and have updated VM hardware versions...

But I should warn you... Making a virtual machine with more than 32 vCPU is probably a bad idea. Especially on a host with 40 cores.

Can you provide some detail on what you're trying to do and why the VM requires so many resources?