Comments (7)
This does seem strange: I know the BBG does fiddle with the RTD timing, but from what you're describing, it seems you're not using any RTD functions in xloil?
run_coroutine_threadsafe should return more or less immediately unless it throws, so I'd suggest putting a try...except around start_hb and logging any error (I would expect xloil to catch and print the error, but there may be some reason why it doesn't)
Also, it's possible to structure this so the user doesn't have to press a button: create an RTD clock and a worksheet function "SEND_HB" which takes a single dummy argument. Point the dummy argument to the output of the clock on the worksheet and it will be called whenever the clock ticks (assuming you have automatic calc enabled).
from xloil.
Another possibility might be https://xlladdins.github.io/Excel4Macros/on.time.html.
This corresponds to the xlcOnTime
function number.
The Bloomberg add-ins do not play nicely with other add-ins.
from xloil.
As an experiment I tried switching to loop = xloil.get_async_loop()
and it appears to do exactly what I want although I can't 100% understand why this works and the other doesn't.
from xloil.
Interesting observation. get_event_loop gives the asyncio loop which is used to background load code and handle ribbon callbacks, and get_async_loop returns the loop which handles RTD functions. Both these loops should be being "pumped" unless the associated thread crashes, so I'm not sure why you see this behaviour but will ponder on it.
from xloil.
@keithalewis Agree that BBG is not friendly, especially the old-skool spill functionality. But I've no idea how it could sabotage my asyncio loop.
Ontime is a good idea, the most Excel-onic approach!
from xloil.
In the past I found that xlcOnTime
is more reliable that Application.OnTime
, but xlcOnTime
can't be called from a UDF context, or from some other thread, so setting it up from the context required is not so useful. xlcOnTime
also used to reset the undo/redo stack every time, which is annoying (though I have not checked recently). I can't remember whether multiple 'OnTime' macros can be scheduled (e.g. by different add-ins). I ended up avoiding both xlcOnTime
and Application.OnTime
completely.
In Excel-DNA I have evolved to an elaborate mechanism that runs a windows message loop on the main thread to receive any notifications (including timer callbacks), then check whether Excel is in a 'receptive' state for invoking a macro (that means Excel is not busy calculating, running a macro, editing a formula etc.) and when safe then invoke a macro from which to execute the work. This has become reliable over time, though included a watchdog check and other enhancements.
RTD-based approaches which stay completely inside the normal Excel calculation world are of course best. Although RTD has its own quirks it tends to work as advertised, integrate well with calculations, including dynamic arrays. The fact that the RTD ThrottleInterval
is a shared setting, global and persistent between Excel sessions, seems to be the biggest gotcha.
I'm always happy to discuss and test any of these low-level Excel ideas - at this level Excel is mostly undocumented, the knowledge base stuff from Microsoft has bit-rotted away and we can only figure out what would through empirically studying Excel like some artifact left by aliens.
from xloil.
Related Issues (20)
- Can I use xloil with 64-bit Python and 32-bit Excel ? HOT 1
- Can you deploy to Windows client without installing python? HOT 1
- Unexplained slowness of method 'Invoke' of 'PyIDispatch' objects HOT 1
- Runtime Error Triggered on Ribbon Reload During Debugging Process HOT 3
- xloil python init failed HOT 3
- Bug Report: xloil.ErrorCode.NA Displays Incorrectly When Assigned Directly to Chart Data HOT 4
- Trouble with Event Callbacks in TaskPane UI HOT 3
- numpy dependency pinning following 2.0.0 release HOT 3
- Hot Reloading of Module doesnt work HOT 15
- in_wizard() not working HOT 2
- install via conda?
- Chart.BeforeDoubleClick Event HOT 3
- How to call a macro from a button and pass arguments HOT 14
- Loading module problems HOT 5
- xloil seems to break the Excel Offset method HOT 4
- xloil.call problem HOT 1
- The Python plugin has about a 20% chance of freezing when opening Excel. HOT 8
- Triggering async UDF from clicking a button HOT 2
- xloil does not disconnect the initial rtd function call after arguments to the function are modified HOT 1
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 xloil.