R
R Avery
I have a public add-in which I would like to extend to be able to allow each
user to customize its menu. Obviously, I do not want to have a custom
menu-creation script for each user. Rather, I would like to store their
preferences locally, and just apply those prefs each time after the menu is
refreshed. However, I have been having a little trouble deciding exactly
where to store this data.
Also, i would like whatever approach I adopt to be flexible and general
enough to work outside of this particular add-in.
My first thought was to create new sheets in each user's Personal.xls that
can house the preferences. Create a named range, and populate it with data.
Then create a class module that represents a 'preference', and have
userforms act as the bridge between the user and the class.
Then, I discovered CustomProperties of a workbook, from which it is very
easy to add and delete. Therefore, to avoid a host of issues relating to
overlapping preferences and multitudes of worksheets in Personal.xls, I
could store all the data (virtually invisibly to both users and programmers
alike, unless they know where I store it) in the CustomProperties.
I have also read that the RecentFiles collection's data is stored in the
Registry... but I don't think that would be a good idea.
I think my 2nd idea is the best, but I am concerned that there may be
additional issues relating to CustomProperties that I might not be aware of.
Therefore, if anyone has done anything similar, or knows anything that could
go wrong (either from a storage or performance standpoint) with
CustomProperties, I would appreciate it if you shared this knowledge.
Of course, if my whole approach is misguided, and there is a much better way
to do what I am thinking, I would appreciate if someone shared that, as
well.
Thanks!
user to customize its menu. Obviously, I do not want to have a custom
menu-creation script for each user. Rather, I would like to store their
preferences locally, and just apply those prefs each time after the menu is
refreshed. However, I have been having a little trouble deciding exactly
where to store this data.
Also, i would like whatever approach I adopt to be flexible and general
enough to work outside of this particular add-in.
My first thought was to create new sheets in each user's Personal.xls that
can house the preferences. Create a named range, and populate it with data.
Then create a class module that represents a 'preference', and have
userforms act as the bridge between the user and the class.
Then, I discovered CustomProperties of a workbook, from which it is very
easy to add and delete. Therefore, to avoid a host of issues relating to
overlapping preferences and multitudes of worksheets in Personal.xls, I
could store all the data (virtually invisibly to both users and programmers
alike, unless they know where I store it) in the CustomProperties.
I have also read that the RecentFiles collection's data is stored in the
Registry... but I don't think that would be a good idea.
I think my 2nd idea is the best, but I am concerned that there may be
additional issues relating to CustomProperties that I might not be aware of.
Therefore, if anyone has done anything similar, or knows anything that could
go wrong (either from a storage or performance standpoint) with
CustomProperties, I would appreciate it if you shared this knowledge.
Of course, if my whole approach is misguided, and there is a much better way
to do what I am thinking, I would appreciate if someone shared that, as
well.
Thanks!