sho Posted October 4, 2019 Posted October 4, 2019 Hi I have previously written a script to create object and set connection name to Session A, as follow: $ops = ObjCreate("PCOMM.autECLPS") $ops.setconnectionbyname("A") $ops.searchtext("text to search for") The above went well when I executed the script using AutoIt3.exe However when I execute it using AutoIt3_x64.exe, it failed as it was unable to create object. Basically, I am trying to search for a specific text on the IBM iseries screen using the function $ops.searchtext("text to search for"). However I am just unable to get this to work using AutoIt3_x64.exe Is there any alternative method? I have tried winexist("Session A", "text to search for"), but it is also not working. I am using AutoIt3_x64.exe as it is more stable than AutoIt3.exe, as AutoIt3.exe keeps crashing after performing multiple loops. Many thanks in advance for any advice.
jchd Posted October 4, 2019 Posted October 4, 2019 The DLL used to deal with this object doesn't seem to be available in X64. You can't invoke X86 DLL from a X64 program, so stick to X86. AutoIt X86 executables shouldn't crash more than X64. You must have a severe issue in your script, like unwanted recursion or the like. Different stack sizes probably explain why it crashes in X86 more than X64. Post a short script showing the issue for actual help, as well as the crash reason. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
sho Posted October 4, 2019 Author Posted October 4, 2019 4 minutes ago, jchd said: The DLL used to deal with this object doesn't seem to be available in X64. You can't invoke X86 DLL from a X64 program, so stick to X86. AutoIt X86 executables shouldn't crash more than X64. You must have a severe issue in your script, like unwanted recursion or the like. Different stack sizes probably explain why it crashes in X86 more than X64. Post a short script showing the issue for actual help, as well as the crash reason. Hi jchd, thank you very much for replying. Basically the part where using X86 will crash is the excel range write after performing more than 300 while loops: While $ops.searchtext("text to search for") = false Sleep(10000) Wend _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "Pass" , "A3") I am doing a while loop to check for a status update on the Iseries screen. However, sometimes it can take up to a few hundred loops before the required text is found. No issue when it is less than 300 loops or when using X64. Repeated the test on a simple text file instead of Iseries application, the same problem will occur when it is more than 300 loops. By the way though I have found an alternative to get the screen text (by copy all, clipget, stringinstr), it is not the ideal way. Was hoping $ops.searchtext could work. But seems like I am currently stuck between get $ops.searchtext to work or getting while loop to work.
jchd Posted October 4, 2019 Posted October 4, 2019 (edited) Very strange. What does the crash box say? And is it actually the Excel write that crashes? Which version are you using? There have been a number of reports that some versions of the Excel UDF have similar issues. Excel UDF emergency team in route. Edited October 4, 2019 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
water Posted October 4, 2019 Posted October 4, 2019 Can you please post the full script you are running? And please post the error message/crash message you get. Which version of Excel do you run? 32 or 64 bit? Which version of AutoIt do you run? Which version of Windows do you run? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
BigDaddyO Posted October 4, 2019 Posted October 4, 2019 Do you need to read from the excel file, or are you just creating it from your script? I used to have lots of problems with Excel crashing on large reports. even when I used the excel .com object directly without the UDF so I created a function to create Excel .xml files using FileWrite. I then just use excel to open that file and saveAs .xlsx https://www.autoitscript.com/forum/topic/189496-create-excel-xml-file-with-multiple-worksheets/ It's not very user friendly and it's currently setup for multiple spreadsheets, but it's an option.
sho Posted October 7, 2019 Author Posted October 7, 2019 On 10/4/2019 at 7:26 PM, jchd said: Very strange. What does the crash box say? And is it actually the Excel write that crashes? Which version are you using? There have been a number of reports that some versions of the Excel UDF have similar issues. Excel UDF emergency team in route. V3.3.14.5 The error box basically just displayed the line of the script which contain the rangewrite function. And whenever I traced it back, it is always the rangewrite right after the while loop.
sho Posted October 7, 2019 Author Posted October 7, 2019 On 10/4/2019 at 7:35 PM, water said: Can you please post the full script you are running? And please post the error message/crash message you get. Which version of Excel do you run? 32 or 64 bit? Which version of AutoIt do you run? Which version of Windows do you run? Sorry, I would very much love to paste the entire script here, but it is in my organisation pc and I can't access the Internet on it, so I am typing the section of the script which the rangewrite failure have occurred based on the previous observations. The excel is ver 14, 64bit, professional plus 2010. AutoIt version is 3.3.14.5 Win OS is win7.
sho Posted October 7, 2019 Author Posted October 7, 2019 On 10/4/2019 at 8:35 PM, BigDaddyO said: Do you need to read from the excel file, or are you just creating it from your script? I used to have lots of problems with Excel crashing on large reports. even when I used the excel .com object directly without the UDF so I created a function to create Excel .xml files using FileWrite. I then just use excel to open that file and saveAs .xlsx https://www.autoitscript.com/forum/topic/189496-create-excel-xml-file-with-multiple-worksheets/ It's not very user friendly and it's currently setup for multiple spreadsheets, but it's an option. Neither. I am basically doing a while loop to search on the IBM I series screen for a specific text, then write to excel only when the text is found. The excel file is a simple blank excel with only some headers, nothing too special or too huge in filesize. Is just that the while loops can run up to a few hundred, for an hour or more.
water Posted October 7, 2019 Posted October 7, 2019 AFAIK 64-bit Office isn't very reliable and widely used. As the Excel part is quite simple I suggest you write the data to a simple file (could be CSV format) and then use Excel separately to process this data. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now