Hello
Go to HP's website for this model, download and install this driver: https://support.hp.com/us-en/drivers/swdetails/hp-envy-6400e-all-in-one-printer-series/model/2100187516/swItemId/mp-309230-19
Then see if it helps with the connection.
Note: This is not Microsoft website/URL, but it is the official OEM/manufacturer site.