weshatheleopard / rubyXL

Ruby lib for reading/writing/modifying .xlsx and .xlsm files
MIT License
1.27k stars 253 forks source link

Overflow: Clip ?? #428

Closed ddarbyson closed 1 year ago

ddarbyson commented 1 year ago

Can someone please tell me how I would set a cell Overflow to clip

I can see in the code there is ST_TextVertOverflowType, but unsure how to define this as default for every cell.

weshatheleopard commented 1 year ago

It depends on what you are trying to do.

But generally you want something like this:

doc = RubyXL::Workbook.new
theme = doc.theme
theme.a_object_defaults.a_sp_def.a_body_pr.vert_overflow = 'clip'

For specicis if your task you need to read through the documentation of OOXML format.

ddarbyson commented 1 year ago

Thank you for your help and quick reply. I would have never been able to figure that out.

However, i'm unable to get this to work. Does this look right to you?

workbook = RubyXL::Parser.parse("./template.xlsx")
theme = workbook.theme
theme.a_object_defaults.a_sp_def.a_body_pr.vert_overflow = 'clip'