MarkBaggett / srum-dump

A forensics tool to convert the data in the Windows srum (System Resource Usage Monitor) database to an xlsx spreadsheet.
GNU General Public License v3.0
596 stars 96 forks source link

'ReadOnlyCell' object has no attribute 'style' #2

Closed amm3 closed 7 years ago

amm3 commented 7 years ago

@MarkBaggett, this is a great tool! I do most of my analysis in MacOs or Linux, so my preference was to use your raw python script. Unfortunately, I'm getting the following openpyxl (using version 2.4.1) error:

Traceback (most recent call last):
  File "./srum_dump.py", line 327, in <module>
    cell_style = template_sheet.cell(row = 4, column = eachcolumn).style
AttributeError: 'ReadOnlyCell' object has no attribute 'style'

It appears (in this version anyway) that the ReadOnlyCell class has different properties than the standard Cell class. Simply changing your call to openpyxl.load_workbook (line 268) to open the template read-write fixed the issue for me. Not ideal, but provides for a quick fix.

(Also, FYI opening read-write appears to be a fairly safe operation if you don't call wb.save().)

MarkBaggett commented 7 years ago

Thanks. I'll get my Mac and reproduce the issue to make sure I understand the problem. Then I'll commit that change. I appreciate the feedback.

Mark

On Jan 14, 2017, at 9:42 AM, Adam Maddock notifications@github.com wrote:

@MarkBaggett, this is a great tool! I do most of my analysis in MacOs or Linux, so my preference was to use your raw python script. Unfortunately, I'm getting the following openpyxl (using version 2.4.1) error:

Traceback (most recent call last): File "./srum_dump.py", line 327, in cell_style = template_sheet.cell(row = 4, column = eachcolumn).style AttributeError: 'ReadOnlyCell' object has no attribute 'style' It appears (in this version anyway) that the ReadOnlyCell class has different properties than the standard Cell class. Simply changing your call to openpyxl.load_workbook (line 268) to open the template read-write fixed the issue for me. Not ideal, but provides for a quick fix.

(Also, FYI opening read-write appears to be a fairly safe operation if you don't call wb.save().)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bdooling commented 7 years ago

I can confirm the issue reported by @amm3, as well as the suggested fix.