function close()
    {
        if ($this->_fileclosed) { // Prevent close() from being called twice.
            return true;
        }
        $res = $this->_storeWorkbook();
        if ($this->isError($res)) {
            return $this->raiseError($res->getMessage());
        }
        $this->_fileclosed = 1;
        return true;
    }