Skip to content

Cookie settings

Choose which kinds of cookies you allow. You can change your choice at any time via Cookie settings at the bottom of every page. Privacy statement

Necessary

Always on

Needed to log in, keep your cart and remember your choices. These are always on.

Which cookies?
  • weboke_sessie, weboke_klant, weboke_remember: your session and staying logged in
  • weboke_basket: your cart
  • wkBtwIncl: showing prices with or without VAT
  • wok_cookies: your cookie choice, 12 months

Measures which ad leads to a visit or order, so we do not pay for ads that do nothing.

Which cookies?
  • Google Ads via Google Tag Manager (_gcl_au, _gcl_aw), up to 90 days
  • OpenAI Ads, ads in ChatGPT
  • wok_aff: which partner referred you to us (affiliate programme), 60 days

4.6

Country and language

Each country has its own site, with prices and VAT for that country.

View

A macro that doesn't work: finding errors

You paste a macro, click Run and nothing happens. No error message, no explanation. This is the most common complaint about macros in Euro-Office, especially with code from the internet or a chatbot. Euro-Office doesn't show macro errors in the document, so you have to make them visible yourself. There are two ways to do this: put the error in a cell, or use your browser's console.

An example with an error

This macro should read the status from E2 and put "Done" in G2. It contains one error: getValue with a lowercase g.

(function () {
    const blad = Api.GetActiveSheet();
    console.log("step 1: sheet found", blad.GetName());
    const status = blad.GetRange("E2").getValue();
    console.log("step 2: status", status);
    blad.GetRange("G2").SetValue("Done");
})();
A macro with an error
If you click Run (1), the triangle above the code, nothing happens and no message appears; Debug (2) next to it gives the same result

When you click Run, G2 stays empty. The macro stops at the faulty line: everything before it has run, nothing after it has.

Method 1: put the error in a cell

Place your macro's code between try and catch. If something goes wrong, the macro jumps to the catch part. There you write the error message to a cell, so you can simply see it in the worksheet:

(function () {
    const blad = Api.GetActiveSheet();
    try {
        const status = blad.GetRange("E2").getValue();
        blad.GetRange("G2").SetValue("Done: " + status);
    } catch (fout) {
        // Show the error message in a cell.
        blad.GetRange("G1").SetValue("Error in the macro:");
        blad.GetRange("G2").SetValue(fout.message);
    }
})();
The error message in cell G2
G2 (1) now shows the error message: getValue is not a function

The message is usually easy to understand. The most common ones:

MessageMeaningSolution
... is not a functionThis method doesn't exist.Check the spelling, with a capital letter: GetValue, SetValue, GetRange.
Cannot read properties of null (reading 'GetName')Something you're asking for doesn't exist. In our test: Api.GetSheet("Archif") with a typo in the worksheet name.Check the name letter by letter, including capitals and spaces.
... is not definedA name is used that was never created.Check that you created the variable with const or let and that the name is spelled the same everywhere.

A typo in the code itself, such as a missing bracket, doesn't produce a message in a cell: the macro doesn't start at all. The code editor does put a red squiggle under the spot, and there's a red mark in the scroll bar on the right.

A typo in the code
A bracket is missing after "loopt": the code editor puts a red squiggle under it

Remove the try and catch once the macro works, or leave them in: they do no harm.

Method 2: your browser's console

For longer macros, you'll want to see how far the macro gets. To do this, add lines with console.log to the code, as in the example above. That text appears in your browser's console.

  1. In your browser, press F12 (on a Mac Cmd+Option+I). The developer tools open.
  2. Click the Console tab.
  3. In the Macros window, click Run.
  4. The console now shows the console.log lines and, in red, the error. In our example: first "step 1: sheet found Orders", then "TypeError: blad.GetRange(...).getValue is not a function". Step 2 never appears: that's where it went wrong.

The Debug button next to Run is meant for stepping through the code line by line with the developer tools. In our test, Debug gave the same result in the console as Run.

Checklist when nothing happens

What isn't possible

  • A message on screen like MsgBox in Excel: a macro can't show a window. A cell with a message is the alternative.
  • A log of previous runs: Euro-Office doesn't record when which macro ran. If you want to keep track, have the macro write a line with the date and time to a worksheet called Log itself.
  • F12 in the app on your phone: the console is only available in the browser on your computer.

One moment…

Set up your domains

For each domain, arrange the nameservers, the link to your hosting and who becomes the owner.

Loading your domains…