Jump to content

Notify if process terminated in between


Recommended Posts

I am trying to add the code that will check if the process gets terminated while some functions are running then a LogPath would be written.

Say, during Step 1 SplashTextOn are the functions and activities going on. If the process is terminated from task manager or get closed for any reason, then a log path would be written.

I have already assigned all the log path process which is working fine and I have given some paths below. I just need to get the logpath added somewhere which will do the termination work.

Say my log path line would be:

_FileWriteLog($InstallEvent, "Process Cancelled.")

 

#Region
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region
$Form1 = GUICreate("Form1", 388, 241, 750, 360)
$Step1 = GUICtrlCreateLabel("Step 1", 32, 40, 42, 20)
$Step2 = GUICtrlCreateLabel("Step 3", 216, 40, 42, 20)
$Step3 = GUICtrlCreateLabel("Step 2", 120, 40, 42, 20)
$Step4 = GUICtrlCreateLabel("Step 4", 312, 40, 42, 20)
$Input_Text = GUICtrlCreateInput("", 48, 104, 289, 24)
$OK = GUICtrlCreateButton("OK", 152, 176, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion

$Log = 0

Func Log()
    If $Log = 0 Then
        ; Creating Logs
        Global $Directory = ; Create the Log file in this folder
        Global $InstallEvent = $InstallFolder & "\" & "Process.log"
        _FileCreate($InstallEvent)
        If FileExists($InstallEvent) Then ; Check we have created the install log file before writing to it
            $Log = 1
        EndIf
    EndIf
EndFunc

While 1
    $nMsg = GUIGetMsg()
    $aInfo = GUIGetCursorInfo($Form1)
    If $aInfo[2] Then
        If $aInfo[4] = $Input_Text Then GUICtrlSetData($Input_Text, "")
    EndIf

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit


        Case $OK
            Select
                Case GUICtrlRead($Input_Text) = '1'
                    $verify = MsgBox(68, "", "Do you want to proceed with Step 1?")
                    Select
                        Case $verify = '6'
                            Exit
                        Case $verify = '7'
                            ; Cancel Exit
                    EndSelect
                    MsgBox(0, "", "step1")
                    ; Running multiple functions
                    SplashTextOn("Step 1", "Running multiple functions under Step 1.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 1 completed.")

                Case GUICtrlRead($Input_Text) = '2'
                    MsgBox(0, "", "step2")
                    ; Running multiple functions
                    SplashTextOn("Step 2", "Running multiple functions under Step 2.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 2 completed.")

                Case GUICtrlRead($Input_Text) = '3'
                    MsgBox(0, "", "step3")
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 3 completed.")

                Case GUICtrlRead($Input_Text) = '4'
                    MsgBox(0, "", "step4")
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 4 completed.")
            EndSelect

    EndSwitch
WEnd

 

Edited by sunshinesmile84
Link to comment
Share on other sites

Is OnAutoItExitRegister() what you are looking for?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

The example in the help file pretty good describes how to use the function, doesn't it?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I tried via multiple ways but nothing works out.  :(

One of the way was:

#Region
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region
$Form1 = GUICreate("Form1", 388, 241, 750, 360)
$Step1 = GUICtrlCreateLabel("Step 1", 32, 40, 42, 20)
$Step2 = GUICtrlCreateLabel("Step 3", 216, 40, 42, 20)
$Step3 = GUICtrlCreateLabel("Step 2", 120, 40, 42, 20)
$Step4 = GUICtrlCreateLabel("Step 4", 312, 40, 42, 20)
$Input_Text = GUICtrlCreateInput("", 48, 104, 289, 24)
$OK = GUICtrlCreateButton("OK", 152, 176, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion

OnAutoItExitRegister($Form1)

$Log = 0

Func Log()
    If $Log = 0 Then
        ; Creating Logs
        Global $Directory = ; Create the Log file in this folder
        Global $InstallEvent = $InstallFolder & "\" & "Process.log"
        _FileCreate($InstallEvent)
        If FileExists($InstallEvent) Then ; Check we have created the install log file before writing to it
            $Log = 1
        EndIf
    EndIf
EndFunc

Func Process_Terminated()
    Switch @error
        ;Case 0
        ;   _FileWriteLog($InstallEvent, "Natural closing.")
        Case 1
            _FileWriteLog($InstallEvent, "close by Exit function.")
            ;MsgBox(0, "", "Process Cancelled")
        Case 2
            _FileWriteLog($InstallEvent, "close by clicking on exit of the systray.")
            ;MsgBox(0, "", "Process Cancelled")
        Case 3
            _FileWriteLog($InstallEvent, "close by user logoff.")
        Case 4
            _FileWriteLog($InstallEvent, "close by Windows shutdown.")
            ;MsgBox(0, "", "Process Cancelled")
    EndSwitch
EndFunc   ;==>Process_Terminated

While 1
    $nMsg = GUIGetMsg()
    $aInfo = GUIGetCursorInfo($Form1)
    If $aInfo[2] Then
        If $aInfo[4] = $Input_Text Then GUICtrlSetData($Input_Text, "")
    EndIf

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit


        Case $OK
            Select
                Case GUICtrlRead($Input_Text) = '1'
                    $verify = MsgBox(68, "", "Do you want to proceed with Step 1?")
                    Select
                        Case $verify = '6'
                            Exit
                        Case $verify = '7'
                            ; Cancel Exit
                    EndSelect
                    MsgBox(0, "", "step1")
            Process_Terminated()
                    ; Running multiple functions
                    SplashTextOn("Step 1", "Running multiple functions under Step 1.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 1 completed.")

                Case GUICtrlRead($Input_Text) = '2'
                    MsgBox(0, "", "step2")
            Process_Terminated()        
                    ; Running multiple functions
                    SplashTextOn("Step 2", "Running multiple functions under Step 2.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 2 completed.")

                Case GUICtrlRead($Input_Text) = '3'
                    MsgBox(0, "", "step3")
            Process_Terminated()        
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 3 completed.")

                Case GUICtrlRead($Input_Text) = '4'
                    MsgBox(0, "", "step4")
            Process_Terminated()                    
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 4 completed.")
            EndSelect

    EndSwitch
WEnd

 

Link to comment
Share on other sites

#Region
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region
$Form1 = GUICreate("Form1", 388, 241, 750, 360)
$Step1 = GUICtrlCreateLabel("Step 1", 32, 40, 42, 20)
$Step2 = GUICtrlCreateLabel("Step 3", 216, 40, 42, 20)
$Step3 = GUICtrlCreateLabel("Step 2", 120, 40, 42, 20)
$Step4 = GUICtrlCreateLabel("Step 4", 312, 40, 42, 20)
$Input_Text = GUICtrlCreateInput("", 48, 104, 289, 24)
$OK = GUICtrlCreateButton("OK", 152, 176, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion

OnAutoItExitRegister("_Terminate")

$Log = 0

Func Log()
    If $Log = 0 Then
        ; Creating Logs
        Global $Directory = ; Create the Log file in this folder
        Global $InstallEvent = $InstallFolder & "\" & "Process.log"
        _FileCreate($InstallEvent)
        If FileExists($InstallEvent) Then ; Check we have created the install log file before writing to it
            $Log = 1
        EndIf
    EndIf
EndFunc

Func Process_Terminated()
    Switch @error
        ;Case 0
        ;   _FileWriteLog($InstallEvent, "Natural closing.")
        Case 1
            _FileWriteLog($InstallEvent, "close by Exit function.")
            ;MsgBox(0, "", "Process Cancelled")
        Case 2
            _FileWriteLog($InstallEvent, "close by clicking on exit of the systray.")
            ;MsgBox(0, "", "Process Cancelled")
        Case 3
            _FileWriteLog($InstallEvent, "close by user logoff.")
        Case 4
            _FileWriteLog($InstallEvent, "close by Windows shutdown.")
            ;MsgBox(0, "", "Process Cancelled")
    EndSwitch
EndFunc   ;==>Process_Terminated

While 1
    $nMsg = GUIGetMsg()
    $aInfo = GUIGetCursorInfo($Form1)
    If $aInfo[2] Then
        If $aInfo[4] = $Input_Text Then GUICtrlSetData($Input_Text, "")
    EndIf

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $OK
            Select
                Case GUICtrlRead($Input_Text) = '1'
                    $verify = MsgBox(68, "", "Do you want to proceed with Step 1?")
                    Select
                        Case $verify = '6'
                            Exit
                        Case $verify = '7'
                            ; Cancel Exit
                    EndSelect
                    MsgBox(0, "", "step1")
            Process_Terminated()
                    ; Running multiple functions
                    SplashTextOn("Step 1", "Running multiple functions under Step 1.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 1 completed.")

                Case GUICtrlRead($Input_Text) = '2'
                    MsgBox(0, "", "step2")
            Process_Terminated()        
                    ; Running multiple functions
                    SplashTextOn("Step 2", "Running multiple functions under Step 2.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 2 completed.")

                Case GUICtrlRead($Input_Text) = '3'
                    MsgBox(0, "", "step3")
            Process_Terminated()        
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 3 completed.")

                Case GUICtrlRead($Input_Text) = '4'
                    MsgBox(0, "", "step4")
            Process_Terminated()                    
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                     Log()
                    _FileWriteLog($InstallEvent, "Step 4 completed.")
            EndSelect

    EndSwitch
WEnd

Func _Terminate()
    _FileWriteLog($InstallEvent, "Script terminated.")
EndFunc

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I "called" function _Terminate in

OnAutoItExitRegister("_Terminate")

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If you want to check the exit method you need to check @exitMethod not @error.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I had to change a few lines because I got syntax errors and missing includes:

#Region
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#Region
$Form1 = GUICreate("Form1", 388, 241, 750, 360)
$Step1 = GUICtrlCreateLabel("Step 1", 32, 40, 42, 20)
$Step2 = GUICtrlCreateLabel("Step 3", 216, 40, 42, 20)
$Step3 = GUICtrlCreateLabel("Step 2", 120, 40, 42, 20)
$Step4 = GUICtrlCreateLabel("Step 4", 312, 40, 42, 20)
$Input_Text = GUICtrlCreateInput("", 48, 104, 289, 24)
$OK = GUICtrlCreateButton("OK", 152, 176, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion

OnAutoItExitRegister("Process_Terminated")

CreateLog() ; Set up Log file

While 1
    $nMsg = GUIGetMsg()
    $aInfo = GUIGetCursorInfo($Form1)
    If $aInfo[2] Then
        If $aInfo[4] = $Input_Text Then GUICtrlSetData($Input_Text, "")
    EndIf

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $OK
            Select
                Case GUICtrlRead($Input_Text) = '1'
                    $verify = MsgBox(68, "", "Do you want to proceed with Step 1?")
                    Select
                        Case $verify = '6'
                            Exit
                        Case $verify = '7'
                            ; Cancel Exit
                    EndSelect
                    MsgBox(0, "", "step1")
                    Process_Terminated()
                    ; Running multiple functions
                    SplashTextOn("Step 1", "Running multiple functions under Step 1.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                    ;_FileWriteLog($InstallEvent, "Step 1 completed.")
                Case GUICtrlRead($Input_Text) = '2'
                    MsgBox(0, "", "step2")
                    Process_Terminated()
                    ; Running multiple functions
                    SplashTextOn("Step 2", "Running multiple functions under Step 2.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                    ;_FileWriteLog($InstallEvent, "Step 2 completed.")
                Case GUICtrlRead($Input_Text) = '3'
                    MsgBox(0, "", "step3")
                    Process_Terminated()
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                    ;_FileWriteLog($InstallEvent, "Step 3 completed.")
                Case GUICtrlRead($Input_Text) = '4'
                    MsgBox(0, "", "step4")
                    Process_Terminated()
                    ; Running multiple functions
                    SplashTextOn("Step 3", "Running multiple functions under Step 3.", 275, 100, -1, -1, "Verdana")
                    Sleep(10000)
                    SplashOff()
                    ;_FileWriteLog($InstallEvent, "Step 4 completed.")
            EndSelect
    EndSwitch
WEnd

Func CreateLog()
    ; Creating Logs
    Local $InstallFolder = @ScriptDir ; Create the Log file in this folder
    Local $InstallEvent = $InstallFolder & "\" & "Process.log"
    _FileCreate($InstallEvent)
EndFunc   ;==>CreateLog

Func Process_Terminated()
    Switch @exitMethod
        Case 0
            ;_FileWriteLog($InstallEvent, "Natural closing.")
            MsgBox(0, "", "Natural closing.")
        Case 1
            ;_FileWriteLog($InstallEvent, "close by Exit function.")
            MsgBox(0, "", "close by Exit function.")
        Case 2
            ;_FileWriteLog($InstallEvent, "close by clicking on exit of the systray.")
            MsgBox(0, "", "close by clicking on exit of the systray.")
        Case 3
            ;_FileWriteLog($InstallEvent, "close by user logoff.")
        Case 4
            ;_FileWriteLog($InstallEvent, "close by Windows shutdown.")
            MsgBox(0, "", "close by Windows shutdown.")
    EndSwitch
EndFunc   ;==>Process_Terminated

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You mean @exitMethod?
If yes, which version of autoIt do you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

That is the version of ScIte.
What do you get when you run

MsgBox(0, "", @AutoItVersion)

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I run the same version of Autoit and do not get the Unknown Macro error.
Can you please post the content of the SciTE output pane after having pressed Ctrl+F5 (Syntax Check)?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I haven't changed anything from your code. When I run as F5, it gives me no error but then closes out after every button action. When I run from the exe, I get the attached error.

Error.jpg

Edited by sunshinesmile84
Link to comment
Share on other sites

The problem is caused by calling function "Process_Terminated()" directly from your code.
Remove all those lines from the "Select" loop.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...