+ Reply to Thread
Results 1 to 5 of 5

using ShellExecute in Windows 7

  1. #1
    Registered User
    Join Date
    10-19-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    4

    using ShellExecute in Windows 7

    Hi,

    I have succesfully used ShellExecute to start a program in Windows XP:

    Please Login or Register  to view this content.
    and a following VBA code:

    Please Login or Register  to view this content.

    Unfortunately sub doesn't work anymore in 64 bit Windows 7. How should I modify the function declaration/code to get it working..??

    Thanks for any help.

    Br,
    Jack

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: using ShellExecute in Windows 7

    Wouldn't this be a clue ?

    "shell32.dll"



  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: using ShellExecute in Windows 7

    What error are you actually getting? There's nothing inherently wrong with the syntax (unless you are using 64bit Office)
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Registered User
    Join Date
    10-19-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: using ShellExecute in Windows 7

    Hi,

    Thanks for your answers. I don't have a 64 bit office. It certainly seems that "shell32.dll" is wrong but i dont know how to modify the declaration. Which I don't understand is that my macro starts the program "Scheduler.cmd" but the program itself doesn't work when starting it with my code. If I just go and double-click "scheduler.cmd" it runs normally.

    Unfortunately i don't understand why is it working when I double-click the software but fails when using the macro. Any ideas on that..?

    Br,
    Jack

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: using ShellExecute in Windows 7

    I suspect it may be a permissions issue. Do you have User Account Control turned on (the default)?

+ 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