validate dimension

Documents imported from Google Docs does not contain dimension data. This change calculate worksheet dimension manually if it is not available.