Auto fit column width and row height

Refer to the following example code in order to automatically fit the row height and column width in a worksheet.