Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New York
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Writing Registry Fails from VBA in Vista (Word all

    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.

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New York
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Writing Registry Fails from VBA in Vista (Word

    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?

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Writing Registry Fails from VBA in Vista (Word

    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.

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Writing Registry Fails from VBA in Vista (Word all

    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?

    <img src=/S/2cents.gif border=0 alt=2cents width=15 height=15>
    Alan

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Writing Registry Fails from VBA in Vista (Word all

    Have you tried whether it does work using getsetting/savesetting?
    Most of my downloads use it and I haven't had complaints yet?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •