Export Worksheet or Chart into Image with Desired Width and Height

Export Worksheet into Image with Desired Width and Height

The following code exports the worksheet into an image with 400x400 size.