• Registry Settings

    • This topic has 3 replies, 2 voices, and was last updated 24 years ago.
    Author
    Topic
    #355652

    How do I store and then read a value in the Registry?

    Viewing 0 reply threads
    Author
    Replies
    • #524960

      In XL 97 and 2000 you can use the SaveSetting statement to write to the registery and the GettSetting Function to retrieve a value. Try the VBA help and search for SaveSetting, and check out the See also pages.

      Andrew C

      • #524967

        Almost There! The example cope from Help is:
        SaveSetting appname := “MyApp”, section := “Startup”, _
        key := “Top”, setting := 75
        I’m OK with the ‘setting’ and ‘key’. Should ‘appname’ be the name of an Object Variable that points to Excel? Also, does ‘section’ need to pre-exist, or will it create a new section? Cheers, Andy.

        • #524979

          If the section does not exist it is created. As I understand it the only KEY you can write to with these functions is

          	HKEY_CURRENT_USERSoftwareVB and VBA Program Settings 

          Also Appname can be the name of your project.

          Try the examples from help , and then check the above key using RegEdit to see the effects.

          There are ways using API calls to interact more deeply in the registry, but unless you know exactly what you are doing, they are best avoided.

          Hope that clarifies

          Andrew C

    Viewing 0 reply threads
    Reply To: Registry Settings

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: