Saving parameters in the Registry?

D

Don Wiss

Someone gave me some code to manage the storing of parameters in the
registry. I sent him an e-mail asking how to use the macros, but I got back
an out-of-office message saying he would be away until June 15th.

My problem is the functions have no documentation for the arguments. So I
have no idea how to use them. I can send anyone interested the workbook
with them all. The functions with their arguments are:

Function QueryValueEx(ByVal lhKey As Long, ByVal szValueName As String,
vValue As Variant) As Long

Public Function CreateNewKey(sNewKeyName As String, lPredefinedKey As Long)

Public Function SetKeyValue(sKeyName As String, sValueName As String,
vValueSetting As Variant, lValueType As Long)

Public Function QueryKey(sKeyName As String, sValueName As String)

On a Workbook_Open I'd like to see if the registry key exists, if not then
to create it and set it to a value of two. If it exists I'd like to read
the value and put it in the range FirstMenu.

Then in the Workbook_BeforeSave event I like to store the value found in
the range FirstMenu. The name of the application is ASF. How would I call
these functions? (I'm using xl2002.)

Don <www.donwiss.com> (e-mail link at home page bottom).
 
D

Don Wiss

You may find it easier using a class wrapper. Steve McMahon's is easy to
use:
http://www.shitalshah.com/vbxlr/codelib/inireg/registry.htm

I found that to be overkill for my needs. And the functions I found in the
Class Module also lacked documentation. So I searched on google on one of
the function names I had. I found that the functions I was given came from
this web page:

http://support.microsoft.com/default.aspx?scid=kb;en-us;145679&sd=tech

And on this page they give examples, so I was able to figure it out.

Don <www.donwiss.com> (e-mail link at home page bottom).
 

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