Source code

Download source archive ↓

src/openpyxl/utils/exceptions.py

1# Copyright (c) 2010-2024 openpyxl
2
3
4"""Definitions for openpyxl shared exception classes."""
5
6
7class CellCoordinatesException(Exception):
8    """Error for converting between numeric and A1-style cell references."""
9
10
11class IllegalCharacterError(Exception):
12    """The data submitted which cannot be used directly in Excel files. It
13    must be removed or escaped."""
14
15
16class NamedRangeException(Exception):
17    """Error for badly formatted named ranges."""
18
19
20class SheetTitleException(Exception):
21    """Error for bad sheet names."""
22
23
24class InvalidFileException(Exception):
25    """Error for trying to open a non-ooxml file."""
26
27
28class ReadOnlyWorkbookException(Exception):
29    """Error for trying to modify a read-only workbook"""
30
31
32class WorkbookAlreadySaved(Exception):
33    """Error when attempting to perform operations on a dump workbook
34    while it has already been dumped once"""