Comments (4)
Are you using the latest version of XLRisk?
Are you using a recent version of Excel?
from xlrisk.
Hi,
I've been having this same issue, and I think I have solved it.
The problem is in Sub ProduceTornadoDiagram() and it only arises if the user has Excel localized to some other language than English. What makes this even more complicated is that, if ProduceTornadoDiagram is excuted in break mode step by step, the code works perfectly well (at least sometimes)...
These two lines seems to be the problem:
mOutSheet.Names.Add Name:="TornadoX", RefersTo:="=INDIRECT(" & Cell.Offset(5).Value & Cell.Offset(6).Address() & ")"
mOutSheet.Names.Add Name:="TornadoY", RefersTo:="=OFFSET(INDIRECT(" & Cell.Offset(5).Value & Cell.Offset(6).Address() & "),0," & Cell.Offset(5).Value & Cell.Offset(2).Address & ")"
For some reason Excel doesn't localize these formulas to the formula notation of the local language before writing them down as named ranges, which will result in error in the next line of the code ( mOutSheet.Range("TornadoY").Select )
This can be seen from the screenshot I took (TornadoX and TornadoY in Risk results 1 are incorrect, Risk results 2 is after the correction):
This can be fixed, for example, by writing the formulas to cells and then reading them back with .FormulaLocal
So for example by changing the previous bit of code like this:
Cell.Offset(7).Formula = "=INDIRECT(" & Cell.Offset(5).Value & Cell.Offset(6).Address() & ")"
Cell.Offset(8).Formula = "=OFFSET(INDIRECT(" & Cell.Offset(5).Value & Cell.Offset(6).Address() & "),0," & Cell.Offset(5).Value & Cell.Offset(2).Address & ")"
mOutSheet.Names.Add Name:="TornadoX", RefersTo:=Cell.Offset(7).FormulaLocal
mOutSheet.Names.Add Name:="TornadoY", RefersTo:=Cell.Offset(8).FormulaLocal
from xlrisk.
Thanks! I was not aware of the localization of function names. I have also found this:
https://stackoverflow.com/questions/13247771/excel-macro-inserting-internationally-valid-formula-during-run-time
from xlrisk.
Hello,
Im using the latest office 365 excel version, and the latest version from github.
I think its a local issue on my own IT environment, so sorry for the issue i raised.
I really appreciate the tool you have created!
Kind regards
Hans Eberwijn
from xlrisk.
Related Issues (14)
- Charts do not get generated after running simulation HOT 11
- Use case question
- Error in Submission Iteration Then Run Time Error 13 HOT 1
- Run time error '91': Object Variable or With block variable not set HOT 17
- Input Variable Missing from Correlations and Risk Tornado Diagram HOT 5
- Run-time error '91': Object variable or With block variable not set HOT 4
- Excel crash when generating the reports HOT 2
- Excel crashes when running some simulations HOT 6
- Incompatible with the version, platform, arch HOT 3
- Run-time error '13': Type mismatch HOT 1
- Tornado graph HOT 6
- Use of Indirect formula for TornadoX and TornadoY named range HOT 1
- Link to worked example Nova.xlsx HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xlrisk.