VBA Modify Registry

G

Guest

Hi,

Just need some help, I'm trying to create a new key and dword value in my
registry using VBA (this is due to an annoying error message from ActiveX
component).
The code below is what I have done
Set oShell = CreateObject("WScript.Shell")
strKeyPath = "SOFTWARE\Microsoft\Office\Common\Security"
oShell.CreateKey HKEY_LOCAL_MACHINE, strKeyPath
strKeyPath =
"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Common\Security"
oShell.RegWrite strKeyPath & "UFIControls", "1", "REG_DWORD"

But I get an error in the CreateKey stage...
Does anyone know what's wrong, or a better alternative to the code?
Thanks!

Cheers,
Mary
 

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