Read/write registry values in VBA

CedarTree

Registered User.
Local time
Today, 18:35
Joined
Mar 2, 2018
Messages
440
Anyone have code that can read/write registry values, including (importantly) Hex/Binary values? THANKS!
 
I don't think this does the trick, but thanks - most of the examples I found online use Windows scripting. But few address the Binary issue.
 
I don't think this does the trick, but thanks - most of the examples I found online use Windows scripting. But few address the Binary issue.
Oh, okay. Good luck!
 
Last edited:

I'll echo Isaac's question. What's wrong with using Windows Scripting? If you look at the thread, it adds at most 2 lines of code to whatever module is involved.
 
Attached is a .bas file which contains code needed to read/write to the registry.
Unzip and import as a standard module.
Note that whilst you can edit the HKCU hive without any problems, you need elevated permissions to edit the HKLM hive.
This is for security reasons. Run your Access app as an administrator if you want to edit the HKLM hive

Hope that helps
 

Attachments

Sorry I wasn't clear. I wasn't against WS. I didn't think theDBguy's example was even using that.
 
Re post #2:
Forgot to say earlier, SaveSetting/GetSetting/DeleteSetting can only be used with one specific registry location:
HKEY_CURRENT_USER\Software\VB and VBA Program Settings.
 
Thanks. I'm going with the route of using Cmd prompt via VBA... that might do the trick and have less limitations, and allow me to change Binary values.
 
The coding above, for example, is good coding, but doesn't handle Binary. But thanks!!!
 
Ah sorry. I forgot to check that part was included. I have that code somewhere else.
No time to look tonight but will have a search tomorrow if I have time.
 

Users who are viewing this thread

Back
Top Bottom