📎 AI Summary:
The thread discusses a registry access issue encountered when running VBA code on Windows 10, despite the path existing and working on Windows 8/8.1. The original poster seeks help to understand if registry key names and paths differ across Windows versions, with suggestions focusing on running code as an administrator and using tools like Process Monitor for troubleshooting. Overall, the community offers guidance on potential permission issues and diagnostic methods to resolve the runtime error.

Imran Bhatti

New Member
Joined
May 5, 2017
Messages
4
Thread Author #1
Hello

Its the very first time I am posting here as I just registered. So please redirect me to the correct forum section of the forum if it is not appropriate for this query.

My question is: "Do the names and paths of the registry keys changed from windows version to version and PC to PC?"

I have written a code in Excel VBA to detect and change the value of a registry.It works fine on my machine with windows 8.1. I have also tested it on another machine with windows 8.
But when trying to run it on a machine with windows 10 ,and error pops up with the following description
"Run-time error"
."Unable to open registry key" name of registry key" for reading" .I will appreciate any help in this
regard
Note: if I manually go and check through regedit.exe,the specific registry key does exist and the path is also the same in windows 10.
Thanks in advance.

Best Regards
Imran Bhatti
 

Last edited:
Solution
You may want to run Procmon on the Windows 10 computer with a filter for that registry key and then run your code and see what you get.

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,995
For the most part registry information has stayed in the same locations. Are you running the code in an elevated context otherwise it will fail. It would also help to know what value you're trying to modify.
 

Imran Bhatti

New Member
Joined
May 5, 2017
Messages
4
Thread Author #3
It would also help to know what value you're trying to modify.
I want to change the bellow to avoid user to view formula.
"HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Options\FormulaBarExpanded"
 

Last edited:

Imran Bhatti

New Member
Joined
May 5, 2017
Messages
4
Thread Author #5
No sir
I am using it on another computer with windows 10,while on windows 8 and windows 8.1 its running fine.
 

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,995
You may want to run Procmon on the Windows 10 computer with a filter for that registry key and then run your code and see what you get.
 

Solution

Imran Bhatti

New Member
Joined
May 5, 2017
Messages
4
Thread Author #7
Was not familiar with this tool now googling for that. Will inform you about the effects. Thanks for your efforts uptill now.