Calc macros - methods for hiding and showing columns

I have written a macro that, among other things, hides and shows columns.

I have eventually got it to work: the .uno:ShowColumn seems only to work if the range includes columns that are showing.

Are there methods for hiding and showing columns? I can't find them in Andrew's book (or elsewhere). I think it likely that this way of doing things would be easier.

David Lynch
4.3.4.1 on Windows 8