• Writing Registry Fails from VBA in Vista (Word all

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Writing Registry Fails from VBA in Vista (Word all

    Author
    Topic
    #445311

    This is a Vista question, but is specific to VBA, so I’m not sure where to post it…

    I have an application that uses extensive reading/writing to the registry to store settings.

    I do not use SetSetting/GetSetting (which write to the VBA Applications key) but System.PrivateProfileString writing the HKEY_CURRENT_USER.

    I now have had two Vista users report the following error message:

    run time error – 2147467259 (80004005)
    Method ‘PrivateProfileString’ of object ‘System’ failed

    Which would seem to indicate that the currently logged in profile does not have permission to modify the registry.

    1) Have other VBA programmers run up against this?

    2) Is there a simple way to have the user elevate their permissions in order to circumvent this problem?

    Thanks for any pointers.

    Viewing 2 reply threads
    Author
    Replies
    • #1079493

      So, digging about a bit it seems that my application works as expected if the user either

      1) runs Word “as administrator”

      or

      2) User Access Control has been turned off.

      Is there a way to make writing to the registry more Vista acceptable, so that these measures are no longer necessary?

      • #1079500

        I don’t have Windows Vista, but I suspect that the only options are the two you mention, plus the user allowing access to the registry key(s) you use in RegEdit.

    • #1079546

      I’m not familiar with Vista Guy, but from what you say I’m guessing that several different users might use different settings on the one machine? If that’s the case, is there any mileage in using an .INI file for each user, in place of registry read/ writes?

      2cents
      Alan

    • #1079559

      Have you tried whether it does work using getsetting/savesetting?
      Most of my downloads use it and I haven’t had complaints yet?

    Viewing 2 reply threads
    Reply To: Writing Registry Fails from VBA in Vista (Word all

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

    Your information: