r - R:如何使用 XLConnect 的 setCellFormula 函数编写非英语的 excel 公式?
问题描述
当我使用 XLConnect 和 setCellFormula 将德语 excel 公式写入工作簿时,相应的单元格显示公式中未解析名称的错误(显示为“#NAME?”)。当我打开工作簿时,输入单元格并使用 ENTER 键将其保留,公式将起作用。
我的代码有问题吗?所有这一切都发生在 windows7 和 Excel 2010 上。
library(XLConnect)
out_wb <- loadWorkbook("test.xlsx", create = TRUE)
createSheet(out_wb, name = "test_data")
writeWorksheet(out_wb, "test_data", header = FALSE, data = 1:50)
createSheet(out_wb, name = "test_calc")
# german formula - cells gives '#NAME?'-error. Result not displayed until you enter the cell and leave it with ENTER
setCellFormula(out_wb, sheet = "test_calc", row = 1, col = 1, formula = "SUMME(test_data!A2:A10)")
# english formula - works as expected
setCellFormula(out_wb, sheet = "test_calc", row = 2, col = 1, formula = "SUM(test_data!A2:A10)")
# recalculation does not solve the issue
setForceFormulaRecalculation(out_wb, sheet = "test_calc", TRUE)
saveWorkbook(out_wb)
手动翻译公式不是一种选择,因为公式很多并且来自文本文件。任何帮助表示赞赏。
解决方案
推荐阅读
- active-directory - 如何在主路径中引用组织单位[windows-server-2012]
- javascript - 在 cellRenderer 函数中设置当前行的 ID,该函数返回 ag-grid 中的锚标记
- c++ - 如何使用 OpenMP 并行化累积概率函数?
- url - HTTP 错误 414.0 - URL 太长。但是网址很短
- php - 在 user_name 的占位符中获取错误值
- java - HSQL 数据库用户缺少权限或找不到对象错误:PERSON,异常从结果集开始
- reactjs - 使用 react-router-dom 时如何在 React 中路由公用文件夹请求
- javascript - 当我执行数据库更新时,我的 Node.js 后端挂起
- javascript - 使用数据表(服务器端),使用来自 url 的过滤器进行查询
- android - 编译器有时找不到生成的导航文件