<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l" -->

---
title: Bringing BERT — R functions in Excel — up to R 4.6
description: BERT (Basic Excel R Toolkit), the add-in that lets R functions run inside Excel cells, has been brought up to date to work across R 3.5 through R 4.6 after its...
canonical: https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bringing BERT — R functions in Excel — up to R 4.6 | daily.dev
og:description: BERT (Basic Excel R Toolkit), the add-in that lets R functions run inside Excel cells, has been brought up to date to work across R 3.5 through R 4.6 after its...
og:url: https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l
og:image: https://api.daily.dev/og/posts/rcIWi8w6l.png
og:image:alt: Bringing BERT — R functions in Excel — up to R 4.6
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bringing BERT — R functions in Excel — up to R 4.6

**[R-bloggers](https://daily.dev/sources/rbloggers)** · 18 min read · 0 upvotes · 0 comments

## Summary

BERT (Basic Excel R Toolkit), the add-in that lets R functions run inside Excel cells, has been brought up to date to work across R 3.5 through R 4.6 after its original author stopped maintaining it in 2018. The write-up covers a race condition that froze Excel whenever an R cell function called back into Excel via xlfCaller, a hand-edited R header that hid a ReadConsole signature mismatch and made clean builds impossible, and a graphics-engine version check that meant plotting only worked on the single R series the module happened to be built against. Fixes include recording Excel's main thread id to route callbacks correctly, restoring the header to match CRAN's, shipping one compiled module per R series built on CI runners instead of one developer's machine, an Electron console upgrade from version 1.8 to 44, function self-documentation via description attributes, and performance numbers (~0.3ms per cell call). The updated fork is 64-bit only and drops Julia support; changes have been offered upstream as a pull request.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.r-bloggers.com/2026/09/bringing-bert-r-functions-in-excel-up-to-r-4-6>

## Questions this post answers

### Why does my Excel add-in freeze on 'Calculating (64 Threads)' when an R function called from a cell tries to call back into Excel, like using xlfCaller?

A race condition in how the callback thread decides whether Excel's main thread is blocked. The code inferred this by testing an event flag that was only reset inside the wait loop, preceded by a leftover Sleep(1000), so for the first second of every spreadsheet call the flag still indicated a console call and the callback was routed through Application.Run into an Excel that was mid-calculation, causing both processes to wait forever. The fix records Excel's main thread id at startup and checks directly whether the current call is blocking.

_Developers hunting deadlocks in Excel add-ins can find writeups like this collected on daily.dev._

### Why does BERT's R graphics device fail with 'Graphics API version mismatch' on some R versions but not others?

R checks a compiled module's graphics engine version whenever a device is created, and that version identifier changes between R series: R_GE_group in 4.2, R_GE_glyphs in 4.5, and R_GE_fontVar in 4.6. A module compiled against one series cannot draw on another, so a build that only shipped a module built against R 4.5 failed to plot on R 4.2 or 4.6. The fix ships one module per R series and loads the one matching the hosted R at runtime.

_daily.dev surfaces posts like this for engineers debugging version-specific native module mismatches._

### Why did my R package build succeed with a hand-edited char* signature for ReadConsole when R 4.2 changed it to unsigned char*?

R 4.2 changed the buffer argument of the ReadConsole callback from char* to unsigned char*, but a local copy of R's headers in the source tree had been manually edited years earlier to keep the old char* signature, so every shipped binary was compiled against a modified header rather than a stock CRAN installation. The fix switches the callback signature based on the R_VERSION macro and restores the local header to match CRAN's original.

_daily.dev collects stories like this for developers whose builds quietly depend on an unclean environment._

## Similar posts on daily.dev

- [R Batteries Included \(R 4.6.1 with OpenBLAS and Intel MKL\) is now publicly accessible](https://daily.dev/posts/r-batteries-included-r-4-6-1-with-openblas-and-intel-mkl-is-now-publicly-accessible-zrzqfxlok) · R-bloggers · 0 upvotes · 0 comments
- [tmustier/pi-for-excel: Experimental Excel sidebar agent add-in. Multi-model. Powered by Pi.](https://daily.dev/posts/tmustier-pi-for-excel-experimental-excel-sidebar-agent-add-in-multi-model-powered-by-pi--dwni83vqw) · Hacker News · 0 upvotes · 0 comments
- [I rebuilt my most complicated Excel workbook in Python with an AI agent's help, and I'm not going back](https://daily.dev/posts/i-rebuilt-my-most-complicated-excel-workbook-in-python-with-an-ai-agent-s-help-and-i-m-not-going-ba-fmn2avvqu) · XDA Developers · 0 upvotes · 1 comments
- [What’s new in R 4.6.0?](https://daily.dev/posts/what-s-new-in-r-4-6-0--hnigwprog) · R-bloggers · 0 upvotes · 0 comments

---

Tags: [#windows](https://daily.dev/tags/windows), [#r](https://daily.dev/tags/r), [#bert](https://daily.dev/tags/bert)

[View this post on daily.dev](https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Bringing BERT — R functions in Excel — up to R 4.6","url":"https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l"},"datePublished":"2026-09-05T09:28:11.956Z","dateModified":"2026-09-05T10:50:16.060Z","description":"BERT (Basic Excel R Toolkit), the add-in that lets R functions run inside Excel cells, has been brought up to date to work across R 3.5 through R 4.6 after its...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"R-bloggers","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"R-bloggers","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/98bcbbdf72774292a55ceda8f2277f1e","url":"https://daily.dev/sources/rbloggers"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"windows,r,bert","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"R-bloggers","item":"https://daily.dev/sources/rbloggers"},{"@type":"ListItem","position":3,"name":"Bringing BERT — R functions in Excel — up to R 4.6"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/bringing-bert-r-functions-in-excel-up-to-r-4-6-rciwi8w6l#faq","mainEntity":[{"@type":"Question","name":"Why does my Excel add-in freeze on 'Calculating (64 Threads)' when an R function called from a cell tries to call back into Excel, like using xlfCaller?","acceptedAnswer":{"@type":"Answer","text":"A race condition in how the callback thread decides whether Excel's main thread is blocked. The code inferred this by testing an event flag that was only reset inside the wait loop, preceded by a leftover Sleep(1000), so for the first second of every spreadsheet call the flag still indicated a console call and the callback was routed through Application.Run into an Excel that was mid-calculation, causing both processes to wait forever. The fix records Excel's main thread id at startup and checks directly whether the current call is blocking. Developers hunting deadlocks in Excel add-ins can find writeups like this collected on daily.dev."}},{"@type":"Question","name":"Why does BERT's R graphics device fail with 'Graphics API version mismatch' on some R versions but not others?","acceptedAnswer":{"@type":"Answer","text":"R checks a compiled module's graphics engine version whenever a device is created, and that version identifier changes between R series: R_GE_group in 4.2, R_GE_glyphs in 4.5, and R_GE_fontVar in 4.6. A module compiled against one series cannot draw on another, so a build that only shipped a module built against R 4.5 failed to plot on R 4.2 or 4.6. The fix ships one module per R series and loads the one matching the hosted R at runtime. daily.dev surfaces posts like this for engineers debugging version-specific native module mismatches."}},{"@type":"Question","name":"Why did my R package build succeed with a hand-edited char* signature for ReadConsole when R 4.2 changed it to unsigned char*?","acceptedAnswer":{"@type":"Answer","text":"R 4.2 changed the buffer argument of the ReadConsole callback from char* to unsigned char*, but a local copy of R's headers in the source tree had been manually edited years earlier to keep the old char* signature, so every shipped binary was compiled against a modified header rather than a stock CRAN installation. The fix switches the callback signature based on the R_VERSION macro and restores the local header to match CRAN's original. daily.dev collects stories like this for developers whose builds quietly depend on an unclean environment."}}]}
```

