View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
M. Authement M. Authement is offline
external usenet poster
 
Posts: 94
Default Best way to use INI file

Thanks Bob/Tom/Chip.

Chip,

I was told that there may be some issues with the security settings on some
of our computers (for certain computers just about everything is locked
down). I didn't have a way to test writing to the registry and I don't know
enough to say whether that may be an issue so I went the INI route. I will
eventually get some test time on the different set up and hope to move to
registry rather than INI, but this is the way it is for now. I learned
quite a bit about classes and API calls during the development so certainly
nothing lost in the effort.

I originally had the settings in the add-in workbook, but realized that
users will change some of them (that is the design) and if I ever update the
code, say using registry rather than INI, I want to just replace the .xla
file but needed a way for the users' to keep their settings. Something
about separating the various layers of the application...I read it in
Professional Excel Development :-)

So that's my rationale...suggestions and corrections are always welcome.
Thanks again for the help.

"Chip Pearson" wrote in message
...
I would read the entire INI file at startup, store the values somewhere,
and then write back the entire INI file at shutdown.

As an aside, INI files were supposed to be made obsolete by the System
Registry. Is there any particular reason you are using an INI file rather
than GetSettings and SaveSetting to store data in the registry.

Moreover, why not just save the settings in the add-in itself?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"M. Authement" wrote in message
...
I am developing an add-in and am using an INI file to store various
options and lists. My question is this: am I better off reading the INI
file into a worksheet as part of the Workbook_Open event (and therefore
having only 1 call to the INI file) or just call the INI file as needed?
I have a class module that defines all of the INI reads/writes, so the
code is no problem. Just wondering if there are advantages/disadvantages
to the two methods. TIA.


Using WinXP and XL2003.