diff --git a/hdf5storage/__init__.py b/hdf5storage/__init__.py
index <HASH>..<HASH> 100644
--- a/hdf5storage/__init__.py
+++ b/hdf5storage/__init__.py
@@ -2557,7 +2557,12 @@ def loadmat(file_name, mdict=None, appendmat=True,
             if variable_names is None:
                 data = {pathesc.unescape_path(k): v for k, v in f.items()}
             else:
-                data = {k: f.read(k) for k in variable_names}
+                data = dict()
+                for k in variable_names:
+                    try:
+                        data[k] = f.read(k)
+                    except:
+                        pass
         # Read all the variables, stuff them into mdict, and return it.
         if mdict is None:
             mdict = data
Fixed bug in loadmat where it would fail if a variable was missing rather than getting whatever ones can be gotten.