Delete a value from the users registry (VBA).

     DeleteSetting appname:="AppName", Section:="Section" [, Key:="Key"]

     DeleteSetting "AppName", "Section" [, "Key"]
   AppName  The name of the application or project.
   Section  The name of the section in which the key is saved.
   Key      The name of the key setting to be deleted.

All the registry entries will appear under HKEY_CURRENT_USER\Software\VB and VBA Program Settings\

If only AppName and Section are provided, then the entire section will be deleted (along with all its keys.)
If the registry key does not exist an error will be raised.


Delete the registry key named "LastOrderViewed":

On Error resume next
DeleteSetting "SS64", "DemoDB", "LastOrderViewed"

“When making a fire people like to join you, when cleaning the ashes you are often alone” ~ African Proverb


GetSetting - Retrieve a value from the users registry
GetAllSettings - List the keys and values saved in the registry
SaveSetting - Store a value in the users registry

Copyright © 1999-2024
Some rights reserved