Simon Berridge's Excel writer new improvement

First of all, thanks Simon for your great Excel Writer, its very cool and very easy to understand.
I saw that you write the Source Code of the excel as a webpage in Excel’s 2004 XML Format, and then save it with .xls extension.

So, I wondered if it exists a function that Wrap Text

  1. So I made a simple Excel worksheet with wrapped text, and then save as XML file.
  2. I open it in TextEdit and I found some interesting attribute: ss:ss:WrapText=“1” , So, when Its unwrapped Value=0, and when its wrapped becames to 1.
  3. So I add this on the Sourcecode method of xlStyle class:

Select Case xlAutoAdjustText
case False
st = st + " ss:WrapText="“0"”"
case True
st = st + " ss:WrapText="“1"”"
End Select

  1. Made a Boolean property named “xlAutoAdjustText”
  2. Made a computed property named “StyleAdjust”
    5.1) Get = return Styles(UBound(Styles)).xlAutoAdjustText
    5.2) Set = Styles(UBound(Styles)).xlAutoAdjustText = value
  3. Write an Excel, declare the Styles at the beginning of text, as this:

xl.AddStyle("SBS000026") xl.StyleHorizontal = xlAlignLeft xl.StyleAdjust = TRUE

  1. Use it:
    xl.SetCellValue(11, i+10, “Testing Text”)//COLUMN, ROW
    xl.SetCellStyleID(11, i+10, “SBS000026”)

Et voila!, wrapped text!.

If I made something wrong or someone suggest a better solution, pls tell me.


Now the next goal is to add and improvement that hides rows or columns.

Or this, for make Row bigger or smaller: <Row ss:AutoFitHeight="0" [b]ss:Height="121[/b]">

So, I’ll do something to make just desired rows bigger.
Because If I modify the Source Code method of xlWorksheet style as this:

It will do all rows bigger

And This piece of code: <Names> <NamedRange ss:Name="Print_Titles" ss:RefersTo="='Rpt-Rcpt-MCE0708241W5'!R1:R9"/> </Names>

For Header or Names Printing


Thank you for your kind comments.

Please send me (or publish a link here) the updated xlStyle class so that I can incorporate it in the distributable.