hexagon logo

To Open/Execute Several Programs Sequentially Using Basic Script

All the while I've been using CallSubs to do that from within the main program, but i've met several bugs and errors from the subroutines i've executed. Can anybody show me a simple basic script to open, execute, save, close several programs simultaneously?
Parents
  • I apologize but the first time I try to do programming for pc dmis.
    This is my complete code.
    Someone tells me where is error?


    Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand


    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram

    Set PCDCommands = PCDPartProgram.Commands

      PCDApp.Visible = True
      PCDPartPrograms.Open "Z:\MM.PRG", "CMM1"
      

    Set PCDPartProgram = PCDApp.ActivePartProgram



    '************************************************* *************
    PCDCommands.MarkAll = True

    'when I open the program it is all marked and in this line was meant to uncheck the manual part


    '************************************************* *************





    Dim WshShell
    set WshShell = WScript.CreateObject("WScript.Shell")

    WScript.Sleep 1000
    WshShell.SendKeys "{ENTER}"
    WScript.Sleep 1000

      
      PCDPartProgram.Execute

      PCDPartProgram.SAVE
      PCDPartProgram.Close


    Set PCDPartProgram = nothing
    Set PCDPartPrograms = nothing
    Set PCDApp = nothing
Reply
  • I apologize but the first time I try to do programming for pc dmis.
    This is my complete code.
    Someone tells me where is error?


    Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand


    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram

    Set PCDCommands = PCDPartProgram.Commands

      PCDApp.Visible = True
      PCDPartPrograms.Open "Z:\MM.PRG", "CMM1"
      

    Set PCDPartProgram = PCDApp.ActivePartProgram



    '************************************************* *************
    PCDCommands.MarkAll = True

    'when I open the program it is all marked and in this line was meant to uncheck the manual part


    '************************************************* *************





    Dim WshShell
    set WshShell = WScript.CreateObject("WScript.Shell")

    WScript.Sleep 1000
    WshShell.SendKeys "{ENTER}"
    WScript.Sleep 1000

      
      PCDPartProgram.Execute

      PCDPartProgram.SAVE
      PCDPartProgram.Close


    Set PCDPartProgram = nothing
    Set PCDPartPrograms = nothing
    Set PCDApp = nothing
Children
No Data