View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Storing important values: ini file, XML, Registry, where else ?

Since W95 the registry is (was?) the preferred location, and there are
simple built in functions in VB to
HKCU\Software\VB and VBA Program Settings
In help SaveSetting and 'see also'

However for quite a while there has been a retro like move back to using ini
by many, including MS (though perhaps they've moved on to xml). There are
plenty of ini examples in this ng, search GetPrivateProfileString &
WritePrivateProfileString.

Would need to consider if you need one ini for all (eg your xla path) or
separate ini's for each user in which case you would need another function
to determine a suitable user path.

A matter of what's simplest and effective for your overall needs.

Regards,
Peter T

"syswizard" wrote in message
ups.com...
For small amounts of data, there seems to be several ways to store
important values and parameters used in an Excel application.
I've always thought that using the ini file approach is the best, but
there are no built-in functions in Excel to read and write this data.
XML seems too verbose and again, there are no XML parsers built into
Excel.
Storing values in the Windows registry seems like one of the best
alternatives.

Anyone have comments on the above ? Obviously using a database like
Access or MySQL is one other alternative, but it seems like it would
be overkill for maintaining a small set of data.

TIA.