+ Reply to Thread
Results 1 to 10 of 10

VBA code needed for calling RegEDIT windows function

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    VBA code needed for calling RegEDIT windows function

    HI,
    I am using Win 7 ultimate and MS Excel 2007 at home and 2010 at work.
    In my form,
    I managed to place the VBA code for calling a Windows remote assistance and remote desktop connection, using the same code but I am stuck trying the same code for REGEDIT function.
    Anyone managed to do that in home and/or working environment?

    Any help or advice (code) appreciated.
    Regards
    Please Login or Register  to view this content.
    I also tried System32 directory path, but no success
    Last edited by JBeaucaire; 05-28-2013 at 10:26 AM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code needed for calling RegEDIT windows function

    If I use your code then I get regedit appear.. what are you trying to do? I think you can edit the registry with the interaction functions, for example:
    interaction.SaveSetting(AppName As String, Section As String, Key As String, Setting As String)

    Maybe a daft question but do you have C:\windows\regedit.exe on your system? Can you call it from say, the command window?

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA code needed for calling RegEDIT windows function

    Thanks yudlugar, I do have regedit on my system at work and I can call it from the command prompt. Although, network setting/windows settings are warning me, would you allow this program to make changes to my computer, I click OK and then windows registry starts properly pointing to my last viewed registry entry.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code needed for calling RegEDIT windows function

    Do you get an error message? Having a look on google (link), it seems that this might be specificly an issue with your excel version/windows version which is why the code works for me and not for you. Unforunately, there isn't a solution in the linked thread and I don't have an idea of what the solution might be...

  5. #5
    Registered User
    Join Date
    05-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA code needed for calling RegEDIT windows function

    3 times I replied and my posts are gone...

  6. #6
    Registered User
    Join Date
    05-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA code needed for calling RegEDIT windows function

    yes, the error message was that code needs to be debug.. so, yellow colored code was: x = Shell(Path + " " + File, vbNormalFocus) ..Tomorrow at work, I will try your google / Microsoft example...cheers

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code needed for calling RegEDIT windows function

    When you get the message that the code needs to debug, click debug, then with code highlighted yellow, press F8 - what is the error message then?

  8. #8
    Registered User
    Join Date
    05-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA code needed for calling RegEDIT windows function

    invalid procedure call or argument

  9. #9
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code needed for calling RegEDIT windows function

    Ok, so I can think of two options, one would be to try the code from here:
    http://stackoverflow.com/questions/4...my-vb6-program
    which I think might allow you to open it if you select run as instead of open:
    Please Login or Register  to view this content.
    Otherwise, I would probably try and get around this problem by using vba to open up the command prompt and launching the shell command from there, rather than directly through vba. Try the above and see if that works first though.

  10. #10
    Registered User
    Join Date
    05-24-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: VBA code needed for calling RegEDIT windows function

    Thanks, did not work. error was after the "end type". I will use the option of calling command prompt and then regedit....cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1