I have a laptop that sleeps when I close the lid. Never fails.
There's another way to shut down/sleep/switch user/sign out/restart etc., that not a lot of folk mention. It is not really worth mentioning, it is really naff.
Click the bottom far right taskbar or press :winkey:+D to show the desktop, then Alt F4 to bring up the shutdown dialog, and select your poison.
The Shut Down Windows dialog is one of the worst implemented dialog boxes I have ever seen in Windows.
"What do you want the computer to do?" - it asks with the W underlined, which is a Windows convention that usually means that either pressing W or Alt+W will do something, perhaps open the drop down list in this case. It does nothing.
Switch user, Sign out, Sleep and Shut down all start with S, and only Restart begins with a different letter, R.
Pressing R selects Restart and S cycles between all the S choices. The arrow keys take you between the bottom and top choices by repeated pressing. Tedious and repetitive, and not intuitive to old hands with Windows. Home and Pg up keys take you to Switch User and Pg dn and End keys take you to Restart. The list is not even in alphabetical order.
The other choice is the bottom left right click to bring up the WinX menu - which is meant to be mouse clicked for the available choices.
If the WinX menu is arrived at by pressing :winkey:+X, the keyboard shortcut letters for the menu choices are underlined.
I think that's actually well thought out and intelligent, unlike the Shutdown dialog.
/rant