Yes. When you close Inventor, any SharedVariables will be lost. They aren't stored in general system memory, they are stored in 'session memory'. Session memory is dumped (lost) when the Inventor 'session' ends (when you close Inventor). SharedVariables can be very handy for sharing data between different rules (both local & external), and don't require you to dirty your document by creating new parameters, iProperties, or attributes (all of which are saved in the document). You can set up some rules to receive 'input' data for use in their main Sub or Function this way, then can also receive 'input' data back from those other rules/macros that way. But they aren't the only way to send/receive (share) data between rules.
Here is a link to it's Interface page in Inventor's online help: ISharedVariable Interface
It is defined within the iLogic Add-in's Interfaces dll. ("Autodesk.iLogic.Interfaces.dll"), so it's not naturally available in the VBA editor.
You can also use RuleArguments and NameValueMaps to share data between them. You'll notice that the 'Arguments' property of RuleArguments is a NameValueMap also. These two can also be used between iLogic rules and VBA macros. You would of course, use the RuleArguments on the iLogic side, if communicating between a rule and a macro, because it too is defined within the iLogic add-in, but NameValueMaps are recognized in both iLogic and VBA.
Here is a link to one of my contribution posts, where I show how to use those two interfaces to send and receive data between two rules, that you might find helpful.
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)