I have worked with excel documents in the past, but for some reason python is REFUSING to open this particular one. I haven't had issues with the openpyxl library before.
The error I'm recieving is this:
Traceback (most recent call last):
File "C:Usersaj200DocumentsGitHubMy-ProjectsMy-ProjectsActive ProjectsAutomated Corona VirusStart.py", line 160, in <module>
book = openpyxl.load_workbook('C:/Users/aj200/Documents/GitHub/My-Projects/My-Projects/Active Projects/Automated Corona Virus/Active-Coronavirus-cases.xlsx')
File "C:Python39libsite-packagesopenpyxl
eaderexcel.py", line 315, in load_workbook
reader.read()
File "C:Python39libsite-packagesopenpyxl
eaderexcel.py", line 280, in read
self.read_worksheets()
File "C:Python39libsite-packagesopenpyxl
eaderexcel.py", line 255, in read_worksheets
charts, images = find_images(self.archive, rel.target)
File "C:Python39libsite-packagesopenpyxl
eaderdrawings.py", line 39, in find_images
cs = get_rel(archive, deps, rel.id, ChartSpace)
File "C:Python39libsite-packagesopenpyxlpackaging
elationship.py", line 168, in get_rel
obj = cls.from_tree(tree)
File "C:Python39libsite-packagesopenpyxldescriptorsserialisable.py", line 87, in from_tree
obj = desc.expected_type.from_tree(el)
File "C:Python39libsite-packagesopenpyxldescriptorsserialisable.py", line 87, in from_tree
obj = desc.expected_type.from_tree(el)
File "C:Python39libsite-packagesopenpyxlchartplotarea.py", line 140, in from_tree
self = super(PlotArea, cls).from_tree(node)
File "C:Python39libsite-packagesopenpyxldescriptorsserialisable.py", line 87, in from_tree
obj = desc.expected_type.from_tree(el)
File "C:Python39libsite-packagesopenpyxldescriptorsserialisable.py", line 103, in from_tree
return cls(**attrib)
File "C:Python39libsite-packagesopenpyxlchartar_chart.py", line 98, in __init__
super(BarChart, self).__init__(**kw)
File "C:Python39libsite-packagesopenpyxlchartar_chart.py", line 57, in __init__
self.grouping = grouping
File "C:Python39libsite-packagesopenpyxldescriptors
ested.py", line 35, in __set__
super(Nested, self).__set__(instance, value)
File "C:Python39libsite-packagesopenpyxldescriptorsase.py", line 128, in __set__
raise ValueError(self.__doc__)
ValueError: Value must be one of {'standard', 'clustered', 'stacked', 'percentStacked'}
Unfortunately, google seems to be of no help with this particular one, and I don't know what the problem is or where it has occured. I presume it's a weirdly formatted cell or something?
The code to replicate this is as follows:
import openpyxl
book = openpyxl.load_workbook('C:/Users/aj200/Documents/GitHub/My-Projects/My-Projects/Active Projects/Automated Corona Virus/Active-Coronavirus-cases.xlsx')
And the download link to the excel file in question. Unfortunately I could not just upload it here directly as I would have preferred: https://www.mediafire.com/file/nra5ekm2n8l0yd2/Active-Coronavirus-cases.xlsx/file
It seems to open perfectly fine through excel, but for some reason my code is erroring out upon attempting to load it.
If anyone could give me a pointer as to what the issue could be, I would be immensely greatful! Normally google would give me an answer, or at least a pointer to the problem, but alas this time it has not helped.
Thanking you all in advance,
Andrey
P.S. I've deleted all data in every cell of both worksheets, and the error still persists. So it is definitely a formatting issue of some sort