VBA Program Settings


It is important to remember that these functions only work with the following key name:

HKEY_CURRENT_USER\Software\VB and VBA Program Settings\ 


Registry Functions

DELETESETTINGSRemoves (or deletes) a key or section from the registry.
GETALLSETTINGSReturns the list of key settings and their values from the registry (Variant).
GETSETTINGReads from the registry and returns the value or key from the registry (String).
SAVESETTINGWrites to the registry and saves a section or key in the registry.

Rather than using the Windows API functions you can use the GetSetting and SetSetting functions.


Call SaveSetting("Userform Positioning", ThisWorkbook.FullName & "-" & Me.Name, "Left", Me.Left") 
Call SaveSetting("Userform Positioning", ThisWorkbook.FullName & "-" & Me.Name, "Top", Me.Top")


VB and VBA Program Settings

This folder does not exist by default
You need to check that it exists before using it


Office 2013



© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext