Skip to content

Can't find any cell by value in Excel #620

Open
@leo-rodriguez-simspace

Description

@leo-rodriguez-simspace

Short summary
I'm trying to reproduce the demo shown in this video:
https://www.youtube.com/watch?v=LOySrifVclw
But even selecting a single cell searching by value is not working for me in Mac nor Win 10
Should I somehow configure Excel to enable this functionality?

Desired execution environment / tested on

  • [ * ] Virtual machine
  • Docker container
  • [ * ] Dev/Host system

node version:
Node 18 (Mac)
Node 20 (Win 10)

OS type and version:
Mac (host) and windows 10 (virtual machine)

Full code sample related to question

import {
    useConsoleLogger,
    ConsoleLogLevel,
    screen,
    windowWithTitle,
} from "@nut-tree/nut-js";
import {useBolt, useBoltWindowFinder} from "@nut-tree/bolt";
import "@nut-tree/element-inspector";
import {elements, windowElementDescribedBy} from "@nut-tree/element-inspector/macos";

useConsoleLogger({logLevel: ConsoleLogLevel.DEBUG});
useBolt();
useBoltWindowFinder();

const excel = await screen.find(windowWithTitle(/Book1/));
await excel.focus();


const elem = await excel.find(windowElementDescribedBy({value: "what"}));
console.log(JSON.stringify(elem, null, 2));
screen.highlight(elem.region);

Detailed question
I'm trying to reproduce the demo shown in this video:
https://www.youtube.com/watch?v=LOySrifVclw
But even selecting a single cell searching by value is not working in Mac nor Win 10:

at Window.find (/Users/leonardo.rodriguez/dev/nutjs-eval/node_modules/@nut-tree/nut-js/dist/lib/window.class.js:111:27)
    at async file:///Users/leonardo.rodriguez/dev/nutjs-eval/excel.mjs:27:14
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

Error: 2025-06-10T02:15:22.506Z - ERROR - [nut.js] - Error: Searching for window-element-described-by-{"value":"what"} failed. Reason: 'Error: No element matching description {
  "value": "what"
}
 found!'

And it looks like getElements() is not returning any TextArea as shown in the video, probably
not all cells are being added to the dom-like structure. Should I somehow configure Excel to allow this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions