Bug: https://rt.cpan.org/Ticket/Display.html?id=131334
From 56a60ded778eed274fcb3f87bfa0e16d31b1ed67 Mon Sep 17 00:00:00 2001
From: Andrius Merkys <andrius.merkys@gmail.com>
Date: Fri, 3 Jan 2020 09:23:31 +0200
Subject: [PATCH] Making sure the ODS spreadsheet is opened prior to the
 addition of a new sheet.

---
 lib/Spreadsheet/Wright/OpenDocumentXML.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/Spreadsheet/Wright/OpenDocumentXML.pm b/lib/Spreadsheet/Wright/OpenDocumentXML.pm
index 1f44cf4..c1911cc 100644
--- a/lib/Spreadsheet/Wright/OpenDocumentXML.pm
+++ b/lib/Spreadsheet/Wright/OpenDocumentXML.pm
@@ -72,6 +72,8 @@ sub addsheet
 {
 	my ($self, $caption) = @_;
 
+	$self->_open() or return;
+
 	$self->{'tbody'} = $self->{'body'}->addNewChild(TABLE_NS, 'table');
 
 	if (defined $caption)
