Clearing Field Data

J

JJ

There is a schedule risk analysis add-on to Microsoft Project called
Risk+ that has its own field mapping. These fields are stored in the
registry.

Before running Risk+, I manually inspect the Risk+ fields and clear
out data which might confuse Risk+. This is done on a copy of the
schedule so that the data is not change when running Risk+. This is a
very tedious process.

Manually, I know I can get to the registry settings and see the fields
that I have set for Risk+. How do I programmatically get to these
registry settings so that I can automate the clearing of this data? In
other words, I need to know how to read registry data via VBA.

Thanks in advance!
JJ
 
J

JJ

ADDITIONAL INFORMATION...

Upon inspection of my registry, Risk+ places the field usage values in
the following registry location:

HKEY_CURRENT_USER\Software\C/S Solutions, Inc.\Risk+\2.0\Field Usage

Some of the Key Names are the following:
Branch Definition
Branch ID
Cost Mean
Cost Standard Deviation

I discovered the "GetSetting" function and created the following code
to try to access the registry settings:

Public Sub RegistryTest()
Dim Test As Variant
Test = GetSetting("HKEY_CURRENT_USER\Software\C/S Solutions, Inc.
\Risk+\2.0", "Field Usage", "Branch ID")
Debug.Print "Key = " & Test
End Sub

The variable "Test" is never populated with a value.
 
R

Rod Gill

Getsetting is useful only when used with Setsetting as it can only refer to
a special VBA branch of the registry. You need to use Windows API's. This
link goes to one way of reading a value. Search for others.

http://www.mvps.org/access/api/api0015.htm

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com




JJ said:
ADDITIONAL INFORMATION...

Upon inspection of my registry, Risk+ places the field usage values in
the following registry location:

HKEY_CURRENT_USER\Software\C/S Solutions, Inc.\Risk+\2.0\Field Usage

Some of the Key Names are the following:
Branch Definition
Branch ID
Cost Mean
Cost Standard Deviation

I discovered the "GetSetting" function and created the following code
to try to access the registry settings:

Public Sub RegistryTest()
Dim Test As Variant
Test = GetSetting("HKEY_CURRENT_USER\Software\C/S Solutions, Inc.
\Risk+\2.0", "Field Usage", "Branch ID")
Debug.Print "Key = " & Test
End Sub

The variable "Test" is never populated with a value.

__________ Information from ESET Smart Security, version of virus
signature database 4680 (20091211) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4680 (20091211) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
J

JJ

The code worked PERFECTLY! Thanks Rod! I could always count on you to
help me out!

Happy Holidays!
 

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