"HKEY_CURRENT_USER" should not be included in your registry key path because
it is relative (in this case you are already using Registry.CurrentUser so
it is redundant). =>
RegistryKey regkey =
Registry.CurrentUser.OpenSubKey("SOFTWARE\\MICROSOFT\\OFFICE\\12.0\\EXCEL\\SECURITY",
true);
--
Stanimir Stoyanov
http://stoyanoff.info
"umesh chape" wrote in message
news:(E-Mail Removed)...
>I want to do following task by using c#.
>
> Run - regedit
> Navigate path -
> HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\OFFICE\12.0\EXCEL\SECURITY
> Rightclick --> new>DWORD>
> add key ExtensionHardening
> value = 0
>
> For that propose i write following code:
>
> RegistryKey regkey;
> regkey =
> Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER\\SOFTWARE\\MICROSOFT\\OFFICE\\12.0\\EXCEL\\SECURITY",
> true);
>
> But i get regkey value is null.
>
> what is wrong in above code.
>
>