Writing to the registry error

juanbolas

New Member
Joined
Dec 3, 2014
Messages
40
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to use some code I found to write a value to the registry. The 'TestRegistry' sub gives me an error when it tries to write the registry key by calling the 'RegKeySave' function.

The error is:

Run-time error '-2147024893 (800700003)
Invalid root in registry key
"Computer\Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LDPTest"

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LDPTest

Can you help me fix the error?

Thanks in advance
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hello,

I'm trying to use some code I found to write a value to the registry. The 'TestRegistry' sub gives me an error when it tries to write the registry key by calling the 'RegKeySave' function.

The error is:

Run-time error '-2147024893 (800700003)
Invalid root in registry key
"Computer\Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LDPTest"

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LDPTest

Can you help me fix the error?

Thanks in advance
I'm not positive since I don't fool with the registry too often, but my best guess is that it's referring to the beginning or root of your path. Maybe Computer\ is generic & you need to change it to reflect your actual system's registry path. Everything after Computer\ should be ok though.
 
Upvote 0
Actual code you are trying to use will be more helpful than the Original post.
 
Upvote 0
@ juanbolas:
For a WScript.Shell object, registry key and value names must start with a hive name, not with a "Computer\".
So, try passing to your function just "HKEY_LOCAL_MACHINE\SOFTWARE\LDPTest" as the key name.
 
Upvote 0

Forum statistics

Threads
1,224,826
Messages
6,181,192
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top