Registry via VBA

A

Arlan

I need to create a registry entry that is available in VBA no matter which
user runs the application. Is there an easy way to do that? Easy or not can
you tell me how?

THANKS!
 
J

Jonathan West

Arlan said:
I need to create a registry entry that is available in VBA no matter which
user runs the application. Is there an easy way to do that? Easy or not
can
you tell me how?

THANKS!

The System.PrivateProfileString feature property in VBA is designed for
this, but I've found it somewhat unreliable, and I don't use it myself.

If you must use the registry, you can access any key or value in the
registry (that the security settings will allow access to) using karl
petersons RegSettings code sample. See
http://vb.mvps.org/samples/project.asp?id=RegSettings for more details. If
you want to use a regsirty key that will be accessible to all users of a
machine, I suggest you create and use one within
HKEY_LOCAL_MACHINE\SOFTWARE.

An alternative approach which mey prove to be rather quicker is to use an
INI file. INI files are an older technology than the registry but still
often prove useful for small bits of configuration data. Again, Karl
Peterson has produced a very useful set of routines called kpIni, which you
can find at http://vb.mvps.org/samples/project.asp?id=kpIni


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top