Name
DeleteSetting Procedure
Class
Microsoft.VisualBasic.Interaction
Syntax
DeleteSetting(appname[,section[,key]])
-
appname(required; String) The name of the application. This must be a subkey of the
HKEY_CURRENT_USER\Software\VBandVBAProgramSettingsregistry key.-
section(optional; String) The name of the application key’s subkey that is to be deleted.
sectioncan be a single key or a registry path separated with backslashes.-
key(optional; String) The name of the value entry to delete.
Description
Deletes a complete application key, one of its subkeys, or a single value entry from the Windows registry
Rules at a Glance
sectioncan contain a relative path (similar to that used to describe the folders on a hard drive) to navigate from the application key to the subkey to be deleted. For example, to delete the value entry namedTestKeyin the registry keyHKEY_CURRENT_USER\Software\VBand VBA ProgramSettings\RegTester\BranchOne\BranchTwo, you would use:DeleteSetting "RegTester", "BranchOne\BranchTwo", _ "TestKey"You cannot use
DeleteSettingto delete entries from registry keys that are not subkeys ofHKEY_CURRENT_USER\Software\VBand VBA ProgramSettings.If
keyis supplied, only the value entry namedkeyand its associated value are deleted.If
keyis omitted, the subkey namedsectionis deleted.If
sectionis omitted, the entire application key namedappnameis deleted.
Example
Sub TestTheReg( ) SaveSetting("MyRealGoodApp", _ "TestBranch\SomeSection\AnotherSection", _ "Testkey", ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access