VBA: Convert centimeters, inches & pixels to points

VBA Code Snippets

It is frustrating that Excel, PowerPoint and Word work natively using a measurement known as points.  However, measurements within the standard application menus are set in centimeters or inches.  This can be seen when setting the position and size of a shape in PowerPoint through the standard menus. Yet, when using a macro to retrieve … Read more

VBA Code to Password Protect an Excel file

VBA Code Snippets

Password protecting an Excel file achieves two main objectives (1) prevents unauthorized access to the Excel file (2) prevents unauthorized modification of the Excel file. File-level protection is not the same as worksheet protection or workbook protection.  Worksheet protection controls what a user can or cannot do on a worksheet, such as inserting rows or … Read more

VBA code to Protect and Unprotect Workbooks

VBA Code Snippets

In a previous VBA Code Snippet, we covered protecting and unprotecting worksheets.  In this post, we will consider protecting and unprotecting workbooks.  The two topics are closely related, so if this post does not provide the information you need, then read that post too. Before getting started, there is an important change in Excel 2013 … Read more

VBA code to create, delete and manage folders

VBA Code Snippets

Creating, deleting and renaming folders is a common requirement when automating processes with VBA.  The code snippets below should be sufficient to complete the most common folder tasks. All the code examples below use the built-in Dir() function and its derivatives.  The File System Object methods are not covered in this post but will be … Read more