# xlf QandA series

## How can I fit the Excel window to 720p resolution

### QUESTION

I SPEND A LOT OF TIME RECORDING THE EXCEL WINDOW IN CAMTASIA STUDIO. I NEED AN EASY WAY OF SETTING THE WINDOW TO 720P RESOLUTION FOR UPLOAD TO YOUTUBE

The VBA code needs to manipulate the Application Width and Height properties.

Details of the properties used in this module.

Application properties Description
Height set propertyA value that represents the height, in points, of the main application window
Width set propertyA value that represents the distance, in points, from the left edge of the application window to its right edge

Note: the 720p value refers to the height of the image in pixels. To convert image pixels to property points; points = pixels x 72 / 96

## The setWindowTo720p procedure

Code 1: The setWindowTo720p macro: using the Application Width and Height properties
Sub SetWindowTo720p()
With Application
.WindowState = xlNormal
.Top = 25
.Left = 25
.Width = 960    ' 960 points = 1280 pixels
.Height = 540   ' 540 points = 720 pixels
End With            ' 720p HD is 1280 wide x 720 high
End Sub                 ' 720p means 720 pixels of vertical resolution


### Resources

• Development platform: Excel 2016 (Office 365 ProPlus) 64 bit, and Camtasia Studio 8.5.0.
• First published: 18 March 2015
• Revised: Saturday 23rd of June 2018 - 07:12 PM, [Australian Eastern Time (AET)]