I have specified SetAutoSize(TRUE) and SetWordWrap(TRUE) for cells. Now when I call SetValueRange() for these cell with a string too large to fit into the cell the cells don't resize. How can I force this?

When you fill cells with SetValueRange() you have to resize them by calling ResizeRowHeightsToFit(). Take a look at the class reference for this function.