ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dictionary and saving workbook/ reopening (https://www.excelbanter.com/excel-programming/365853-dictionary-saving-workbook-reopening.html)

[email protected]

Dictionary and saving workbook/ reopening
 
If I have a scripting.dictionary object that is declared in a module
and used by a variety of functions in my workbook, and then I save my
workbook and close it, will that dictionary still be around with the
same data in it when I reopen the workbook. If not, how could I make it
so it would?

Thanks in advance,

-Abe


Tim Williams

Dictionary and saving workbook/ reopening
 
The object will go out of scope when you close the workbook containing it.
Depending on what you're storing in the dictionary, you may be able to persist the contents by (eg) writing the string key/value
pairs to a file or worksheet. If you're storing objects in the dictionary then you'd have to persist each object in a storable
format (eg. string) and reccreate the objects when the dictionary is recreated ans populated.

--
Tim Williams
Palo Alto, CA


wrote in message oups.com...
If I have a scripting.dictionary object that is declared in a module
and used by a variety of functions in my workbook, and then I save my
workbook and close it, will that dictionary still be around with the
same data in it when I reopen the workbook. If not, how could I make it
so it would?

Thanks in advance,

-Abe




Abe[_4_]

Dictionary and saving workbook/ reopening
 
That's what I was afraid of, I have picture objects in the
dictionary... but I think I know what I can do to make it work
alright... it just means more coding.
Thanks Tim.
-Abe

Tim Williams wrote:
The object will go out of scope when you close the workbook containing it.
Depending on what you're storing in the dictionary, you may be able to persist the contents by (eg) writing the string key/value
pairs to a file or worksheet. If you're storing objects in the dictionary then you'd have to persist each object in a storable
format (eg. string) and reccreate the objects when the dictionary is recreated ans populated.

--
Tim Williams
Palo Alto, CA


wrote in message oups.com...
If I have a scripting.dictionary object that is declared in a module
and used by a variety of functions in my workbook, and then I save my
workbook and close it, will that dictionary still be around with the
same data in it when I reopen the workbook. If not, how could I make it
so it would?

Thanks in advance,

-Abe



NickHK

Dictionary and saving workbook/ reopening
 
Abe,
You could have a hidden WB in your XLSTART folder (or use Personal.xls) and
copy the pictures to there. As long you name them so you can retrieve the
correct one later.

NickHK

"Abe" wrote in message
ups.com...
That's what I was afraid of, I have picture objects in the
dictionary... but I think I know what I can do to make it work
alright... it just means more coding.
Thanks Tim.
-Abe

Tim Williams wrote:
The object will go out of scope when you close the workbook containing

it.
Depending on what you're storing in the dictionary, you may be able to

persist the contents by (eg) writing the string key/value
pairs to a file or worksheet. If you're storing objects in the

dictionary then you'd have to persist each object in a storable
format (eg. string) and reccreate the objects when the dictionary is

recreated ans populated.

--
Tim Williams
Palo Alto, CA


wrote in message

oups.com...
If I have a scripting.dictionary object that is declared in a module
and used by a variety of functions in my workbook, and then I save my
workbook and close it, will that dictionary still be around with the
same data in it when I reopen the workbook. If not, how could I make

it
so it would?

Thanks in advance,

-Abe






All times are GMT +1. The time now is 11:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com