logo
search
VBA & Macro Problems

How to Fix Invalid Use of Property for Word VBA InlineShape ScaleHeight

Muhammad TalhaMuhammad Talha Oct 10, 2026 870 views

Question details

The user needs to resolve an 'invalid use of property' error when attempting to set the ScaleHeight and ScaleWidth of an InlineShape in Word VBA.

Fix 'Invalid Use of Property' for Word VBA InlineShape ScaleHeight
Product
Word
Device & OS
not provided
Scenario
Writing or executing a VBA macro to resize an inline shape in a Word document using VBA code.
Observed behavior
Word VBA throws a compile or runtime error stating 'invalid use of property' when using method-style syntax (parentheses) to pass values to ScaleHeight or ScaleWidth.
Before you start

Ensure you have the Developer tab enabled in your Word application and can access the VBA Editor (Alt + F11) to modify your macro script.

Solution 1Recommended

Assign Values Directly as Properties

Change the code syntax from a method call (using parentheses) to a direct property assignment (using the equals sign).

In Word VBA, ScaleHeight and ScaleWidth are defined as Single properties of the InlineShape object, not as methods. Attempting to pass arguments in parentheses triggers the 'Invalid use of property' compile error.

1
Open the VBA Editor

Press 'Alt + F11' on your keyboard to open the Visual Basic for Applications (VBA) Editor.

2
Locate the problematic code

Find the line of code that looks similar to: Selection.InlineShapes(1).ScaleHeight(60) or Selection.InlineShapes(1).ScaleWidth(60).

3
Modify the syntax to property assignment

Remove the parentheses and use an equals sign to assign the value. Change it to: Selection.InlineShapes(1).ScaleHeight = 60.

4
Update ScaleWidth accordingly

Ensure ScaleWidth is also updated to use the equals sign: Selection.InlineShapes(1).ScaleWidth = 60.

5
Run the Macro

Press 'F5' or click the 'Run' button on the toolbar to execute the updated macro. The shape should now resize without throwing an error.

Assign Values Directly as Properties
Variable Assignment: For cleaner code, declare a variable first: Dim scaleSize As Single, then assign scaleSize = 60, and finally apply it: Selection.InlineShapes(1).ScaleHeight = scaleSize.
Advanced VBA Support in WPS

Run and Edit VBA Macros Seamlessly in WPS Office

WPS Writer offers robust support for VBA macros, allowing you to easily run, edit, and debug scripts for automating document formatting and resizing inline shapes.

  1. 1. Open your macro-enabled document: Launch WPS Writer and open your .docm or .doc file containing the VBA macros.
  2. 2. Access the VBA Editor: Navigate to the 'Developer' tab on the ribbon and click 'Visual Basic' or press 'Alt + F11'.
  3. 3. Edit the InlineShape properties: Locate your macro code and update the ScaleHeight and ScaleWidth syntax to use the equals sign assignment.
  4. 4. Execute the macro: Click the 'Run' icon or press 'F5' within the WPS VBA Editor to apply your changes to the document.
Fully compatible with Microsoft Word VBA syntax and object modelsBuilt-in VBA editor for seamless macro debugging and executionSupports .docm and .dotm macro-enabled document formatsLightweight application ensures fast and responsive macro processing
microsoft office alternative - wps office

Frequently Asked Questions

What does 'Invalid use of property' mean in VBA?

This error occurs when you attempt to use a property as if it were a method (e.g., passing arguments inside parentheses instead of using an equals sign to assign a value), or when you try to assign a value to a read-only property.

Why does my Excel VBA shape-resizing code fail in Word?

Excel and Word use different object models. Excel primarily handles floating shapes on a Worksheet, while Word distinguishes between floating Shapes and InlineShapes (shapes embedded in the text layer). The properties and methods for manipulating them are not identical.

How do I resize all images in a Word document using VBA?

You can use a 'For Each' loop in VBA to iterate through all images. For example: Dim shp As InlineShape; For Each shp In ActiveDocument.InlineShapes; shp.ScaleHeight = 50; shp.ScaleWidth = 50; Next shp. This will scale all inline shapes to 50%.