I have a strange behavior in an Autoit program.
The program works perfectly in the original environment I created the program for - for Windows 7 and Office 2010.
My workplace is migrating to Windows 10 with Office 2016. When I run this program in that new environment, the code actually executes without any errors, however, the excel process which was opened to read a spreadsheet/workbook does not close while the program is running. If you exit the program, the excel process ends at that point...
I could ignore this behavior - one little excel process hanging out there is not going to kill anything, however - it just bugs me !
While troubleshooting the issue, I placed a number of error checks after the excel close - and the close actually reports that it is successful.
I tried a few varieties of closing the excel process, and none of the methods tried seemed to actually work as well at the one in my code - the only downside being that it has to wait until the program finishes to actually close.
Any ideas on why an excel close would hang until program exit ?
Local $oExcel = _Excel_Open(False, False, False, False, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, $sUserRoleMenuXLS, False, true ) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF", "Error opening workbook '" & $sUserRoleMenuXLS & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel, False, False) Exit EndIf ; this section will find the user id in the first 3 columns of the user/menu spreadsheet, and if it finds it - returns the value stored in the cell 2 locations to the right... With $oExcel.ActiveSheet.Range("A:C").Find (@UserName) $Match = .Find (@UserName) If (Not IsObj($Match)) or (stringlen($Match.Offset(0, 2).value) = 0) Then MsgBox($MB_SYSTEMMODAL, 'UIPLauncher Error', 'No Menu assigned for user - Contact Support.') ; Display a warning if the script isn't compiled or the file doesn't exist. ;_Excel_BookClose($oWorkbook, False) _Excel_Close($oExcel, false, false) Exit Else Local $cResult = $Match.Offset(0, 2).value EndIf EndWith $oWorkbook.Saved = True _Excel_BookClose($oWorkbook, False) _Excel_Close($oExcel, false, false) ;close does not seem to work on windows 10 and office 2016
I am not able to use the $GUI_READ_EXTENDED with the Metro UDF, any work around ?
Local $aPos = [$Radio1, $Radio2] For $Radio In $aPos If GUICtrlRead($Radio) = $GUI_UNCHECKED Then ContinueLoop IniWrite($sGUIstate_IniFile, "Data", "POS", GUICtrlRead($Radio, $GUI_READ_EXTENDED)) ;; return the text of the menu item ExitLoop Next
hello autoit group
please i've a question
i had make a function that put some thing into the clipBoard and paste it
using the send function
when the keyboard is english all things work fine
but when the keyboard is arabic the send command write the ltr v insted of the text in clipboard
i was tryed to use
but the same
please can any one help me
If you're interested in the story, read below. Otherwise, just jump to the end of the post.
Sometimes my computer goes crazy with Windows update. I tried to turn it off with "services.msc", but couldn't close the it. So, I did some research online that it's triggered by Update Orchestration and Task Scheduler and Windows Update. I also checked that all three processes are triggered by svchost.exe.
So, I tried to make a script to close this process. I found some useful functions ProcessList and _ProcessGetName using the help documents and coded something as below:
#include <MsgBoxConstants.au3> #include <Process.au3> Local $aProcessList = ProcessList() For $i = 1 To $aProcessList $iPid = $aProcessList[$i] $sName = _ProcessGetName($iPid) MsgBox($MB_SYSTEMMODAL, "The process", "PID: " & $iPid & @CRLF & "NAME: " & $sName) If $sName = "svchost.exe" Then ;ProcessClose($iPid) ;I don't know if this is the process I want to close EndIf Next But the problem is; there are so many svchost.exe exists in the process list. I can't close all of them, some of them are essential to run Windows (well, accidentally I terminated some of them and ended up with a blue screen
Well, how can I know the process name like "Service Host: Update Orchestration" (not the scvhost)?
It's not only with the .exe file, just to the name shown in Windows.
I have this AutoIt script that works on Windows 7. However, when I test it on Windows 10, the objEvent will not execute the function it's supposed to call. So I have a webpage the script will check if it is active, then it will search if a popup button exist (elementId), if so, assign it to the event handler so that when that button is clicked, then handler function will move the focus back to the main GUI again.
If WinActive("Website Title - Internet Explorer") Then $ie = _IEAttach("Website Title") $objElement= _IEGetObjById ($ie, "elementId") local $oEvent = ObjEvent($objElement, "_MY_EVENT_HANDLER_") EndIf Func _MY_EVENT_HANDLER_onclick($oEvtObj) msgbox(0,"Alert Window", "Button Clicked!") setMainWindow() ; sets focus back to main GUI EndFunc
I've verified, on Windows 10, that it does see the object element. But it will not trigger the event. Could it be related to some timing issues due to Windows 10 Internet Explorer over Windows 7 Internet Explorer?
Windows 7 IE version 11.0.9600.19507
Windows 10 IE version 11.418.18362.0
AutoIt v 3.3