Consulting

Results 1 to 3 of 3

Thread: Shell Cmd Works on Some Computers, But Not Others

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Oct 2010
    Posts
    85
    Location

    Shell Cmd Works on Some Computers, But Not Others

    On some computers/companies, the shell command will not run.

    I am using this code, but have used other approaches to call a windows command shell:
    http://www.cpearson.com/excel/ShellAndWait.aspx

    It stops here, which may give an better idea about why it won't run the command shell:

    ProcHandle = OpenProcess(SYNCHRONIZE, False, TaskID)
    If  ProcHandle = 0 Then
        ShellAndWait =  ShellAndWaitResult.Failure
        Exit Function
    End  If
    My best guess is that this computer system/company has incorporated something that restricts Excel VBA from actually running the shell command. Perhaps this is set by IT or anti-virus, etc.? I suppose this might be a security measure/setting?
    Last edited by Aussiebear; 07-10-2024 at 03:48 PM.

Posting Permissions

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