I’ve been looking at how to use cookies to pass data between excel sessions and of course outside Excel. Having implemented a method of hiding data inside cells and Excel shapes, I figured this would be a nice next step.
Generate an .html file that can read or write cookies, and generate the data required to be stored as part of the javascript.
Create a cookie into which the contents of the cookie are populated by the generated javascript
Read the appropriate element of the document to find the contents of the cookie.
In the cookie I store JSON formatted data. This means that it carries its own definition and can be used directly by other Javascripts.
I hit a few snags along the way that were related to being able to run local scripts with active content, but i came across something called ‘mark of the web’, which seems to trick the browsers I’ve tried into being able to run it. I’ll be writing this up on web site shortly so you can read all about it there
I am a Google Developer Expert and decided to investigate Google Apps Script in my spare time.
The more I investigated the more content I created so this site is extremely rich. Now, in 2019, a lot of things have disappeared or don’t work anymore due to Google having retired some stuff. I am however leaving things as is and where I came across some deprecated stuff, I have indicated it.
I decided to write a book about it and to also create videos to teach developers who want to learn Google Apps Script. If you find the material contained in this site useful, you can support me by buying my books and or videos.
Can we use cookies inside Excel This is a follow on from my thoughts around using JSON both to store data inside Excel shapes and cells, and also to pick up data from external sources. […]
1 Comment
Here is the link for the write up on how to do this
bruce mcpherson is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.mcpher.com. Permissions beyond the scope of this license may be available at code use guidelines
Here is the link for the write up on how to do this
http://sites.mcpher.com/share/Home/excelquirks/cookies-and-excel