1

Is there a way to have a variable (resulting from one script) accessible to other scripts while Excel is running?

I have tried from script1 import df but it runs script1 again to produce df. I have a script that runs when I first open the workbook and it reads a dataframe and I need that dataframe for other scripts (or for other button clicks). Is there a way to store it in memory or should I read it every time I need it?

ayhan
  • 70,170
  • 20
  • 182
  • 203

1 Answers1

1

There's no way to share the dataframe (each DataNitro script runs in its own process). You can read the frame each time, or if reading is slow, you can have the first script store it somewhere the other scripts can access it (e.g. as a csv or by pickling it).

Ben Lerner
  • 1,318
  • 9
  • 12