Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing recalculation when using time-triggered Google Script Function #18

Open
davidalvarezm opened this issue Apr 6, 2020 · 3 comments

Comments

@davidalvarezm
Copy link

While following the muFund guide to save history of mutual funds, I had not got values for muFund formulas when the script was triggered automatically. I finally got it solved by adding to suggested code flush function at script initiation, which reclaculates all values within the Spreadsheet: SpreadsheetApp.flush().
I just recommend to include this in the guide: https://mufunds.com/history.html

@davidalvarezm
Copy link
Author

Fail! Although it did work the first time I have been testing it few days without success. Now I am not able to automatically run the muFund function with the time-trigger. Any clue?

@davidalvarezm
Copy link
Author

I have tried by playing with the google sheet permissions (edit anyone with link, public...), and activating the sheet where muFunds are applied before using flush() function, but nothing. Script still gives #NAME errors. The worst thing is that the error is not consistent. Sometimes it works fine. Any idea? @joseballester have you ever find this error?

@franry
Copy link

franry commented Apr 23, 2020

To your initial question. I have been playing around with muFunds for several weeks now. Trying to get the spreadsheet to update by running a script. It looks like this is not possible by design. I ended up with a workaround. Make a Macro that makes a copy - delete and re-insert of the ISIN's for the funds you want to update. Find the Macro in macros.gs. Do some changes so the macro is running in the sheet that it is supposed to (var sheet1 = "Yoursheetname";). And call it form a trigger.

I have also looked at this solution:
https://github.com/sheets-market-data/refresh-tool

This guy has a script that looks thru all formulas in the sheet. Delete them and re-inserts them. It works, but I could not find a proper way to control the thing, so I gave up on him. I have been programming in several languages, but I am not a programmer. So it was a little to heavy for me JS is also new for me.

FYI I have also made a script that copies the NAVs to history, it can be shared if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants