logo
search
Others

How to Capture Image Click Coordinates in Excel or Word

Maira MehtabMaira Mehtab Sep 27, 2026 872 views

Question details

The user wants to create an interactive form that records specific image clicks, sequential numbers, X and Y coordinates, dispensed amounts, lot numbers, and expiration dates.

Product
Excel or Word
Device & OS
not provided
Scenario
Building an advanced interactive form within a document or spreadsheet to log exact interaction points and associated metadata.
Observed behavior
Implementing this workflow natively requires extensive custom development, making standard office software potentially unsuitable for the task.
Before you start

Before attempting to build this workflow, ensure you have the Developer tab enabled in your Office application and possess a solid understanding of VBA (Visual Basic for Applications) and custom event handling.

Solution 1

Use VBA and Form Controls in Excel for Windows

Implement custom VBA macros and ActiveX event handling in Excel to capture X and Y coordinates when an image is clicked.

While it is theoretically possible to record image clicks and coordinates using Excel for Windows, it requires extensive custom VBA development. You must utilize ActiveX form controls and program custom event handlers to capture mouse events on the image and write that data into specific spreadsheet cells.

1
Enable the Developer Tab

Go to File > Options > Customize Ribbon and check the box for the Developer tab to make it visible.

2
Insert an Image Control

Navigate to the Developer tab, click Insert, and choose the Image control under the ActiveX Controls section. Draw it onto your worksheet.

3
Access the VBA Editor

Right-click the newly inserted image control and select View Code to open the Visual Basic for Applications editor.

4
Write Custom Event Handlers

Use the MouseDown event for the image control to capture the 'X' and 'Y' parameters provided by the event, and write VBA logic to output these values, along with your lot numbers and sequential data, into your tracking table.

Maintenance Warning: This solution can be highly difficult to maintain and requires advanced programming skills. Complex event handling in Excel can sometimes lead to instability or a poor user experience.
Advanced VBA Support in WPS Office

Use WPS Spreadsheets to Build Custom Macros

WPS Office provides robust support for VBA and form controls, allowing you to develop advanced macros and interactive elements directly within your spreadsheets for free. If you choose to build this complex workflow in a spreadsheet, WPS Office gives you the exact tools you need.

  1. 1. Download and Install: Download WPS Office and open WPS Spreadsheets.
  2. 2. Enable Developer Tools: Navigate to the Developer tab to access form controls and the VBA environment.
  3. 3. Insert Controls and Write Code: Insert your desired form controls and click 'Visual Basic' to script your MouseDown coordinate tracking logic.
Full compatibility with Microsoft Excel VBA macros (.xlsm)Free, lightweight, and easy to use interfaceBuilt-in Developer tools for form controls and custom logic
microsoft office alternative - wps office

Frequently Asked Questions

Can I natively capture image click coordinates without VBA in Excel?

No, Excel does not have a built-in feature to track exact X and Y mouse click coordinates on an image without relying on custom VBA code and ActiveX controls.

Why is a dedicated app recommended over Excel or Word for tracking clicks?

Excel and Word are primarily document and data analysis tools. Building complex interactive applications with extensive event handling in them can lead to poor performance, difficult maintenance, and a subpar user experience.

Will Excel VBA macros for tracking mouse events work on macOS?

Custom ActiveX controls and specific Windows API calls often used in advanced VBA event handling for tracking exact screen coordinates are generally only supported on Excel for Windows and may not function on a Mac.