
Kruxe
Active Members-
Posts
27 -
Joined
-
Last visited
Everything posted by Kruxe
-
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
Good to know, thanks for the info! -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
sounds good to me! haha -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
I think I solved the issue.. 1. So originally I was using the excel UDFs codded in the fashion below and excel was still popping up on some PCs. Global $oExcel = _Excel_Open(False) Global $oWorkbook = _Excel_BookOpen($oExcel,"File Path to Shared Workbook") 2. I attempted to change the parameters of the UDFs even further and it still popped up.. Global $oExcel = _Excel_Open(False) Global $oWorkbook = _Excel_BookOpen($oExcel,"File Path to Shared Workbook", True, False) 3. Finally I just ended up creating the object and using the COM rout. This worked, Excel does not show up on any PC. Global $oExcel = ObjCreate("Excel.Application") Global $oWorkbook = $oExcel.Workbooks.Open("File Path to Shared Workbook") $oExcel.Visible = False Could there be an issue with the way the Excel UDF is handling this? Again, I really appreciate your time and help, just wanted to share the solution that's currently working for me. - Kruxe -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
pooo =[ -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
so I removed all the add-ins and it still pops up! I made it a regular workbook (Was a shared workbook) and it works fine... Only issue is.. I need it to be shared LOL! -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
ahhh! I did notice an add-in installed in the ribbon bar, I will try to remove it and run the script again. thanks again for the help water! Kruxe -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
so it does become visible after the MsgBox.. -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
I did not see any instances of Excel running and it still popped up. Now the file is a shared file, could that have anything to do with it? its just weird because its hidden on other PCs.. -
Excel Hidden on some PCs (as coded) but shows on others.
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
Hey Water, I'm not sure what you mean, I'm not getting an error at all. The script executes and does what it is coded to do but on some PCs excel just pops up.. the @extended return shows "1" -
Hi all, I'm experiencing an issue with excel where when the script executes, excel will be hidden on some PCs but shows up on others. All the PCs have the same version of Microsoft office installed and I'm executing the same script coded with the line below that is supposed to keep excel hidden. Has anyone experienced this issue before or am I the only one? Local $oExcel = _Excel_Open(False) thanks for the help! Kruxe
-
How to Get Application Events - (Moved)
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
Imports PCDLRN Public Class PCDMIS Dim DmisApp As PCDLRN.Application Dim DmisPartPrograms As PCDLRN.PartPrograms Dim WithEvents AppEvents As PCDLRN.ApplicationObjectEvents Private Sub PCDMIS_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try DmisApp = CreateObject("PCDLRN.Application") DmisApp.Visible = True DmisApp.WaitUntilReady(1000) DmisPartPrograms = DmisApp.PartPrograms AppEvents = DmisApp.ApplicationEvents Catch ex As Exception MsgBox(ex.StackTrace) Environment.Exit(0) End Try End Sub Private Sub OpenProg_Click(sender As Object, e As EventArgs) Handles OpenProg.Click Try Hide() DmisPartPrograms.Open("", "CMM1") Catch ex As Exception MsgBox(ex.StackTrace) End Try End Sub Private Sub AppEvents_OnStartExecution(PartProg As PartProgram) Handles AppEvents.OnStartExecution MsgBox("Execution started: " & PartProg.Name) End Sub So this is capturing the event just fine using VB, but i don't want to use VB, i want to use auuutooooiiiiitttt lol -
How to Get Application Events - (Moved)
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
Guys, I don't think this is as simple as following these examples or, maybe it is! lol. The application I'm trying to capture the events from is kind of setup weird and I think autoit can do it but my syntax is probably incorrect. the event I am trying to listen for is "OnStartExecution". I have posted a link to the Object Hierarchy chart and hopefully it can explain batter than i can on here. Also in this post is what i have so far for code but I have had absolute 0 success with it. Local $DmisApp = ObjCreate("PCDLRN.Application") Local $ActivePartProgram = $DmisApp.ActivePartProgram Local $AppEvent = $DmisApp.ApplicationEvents While 1 ObjEvent($AppEvent,"ExEvent_") Sleep(10) WEnd ; ... Func ExEvent_() MsgBox("","","EventFired") EndFunc https://docs.hexagonmi.com/pcdmis/2019.1/en/helpcenter/mergedProjects/automationobjects/object_hierarchy_chart.htm -
How to Get Application Events - (Moved)
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
@water coming back to this post after some time and im still struggling with it. Im not grasping how i am supposed to set the code up in autoit to be like the VBA code above. I am not familiar with VBA but maybe one of you can what i have gotten so far is this and honestly don't know if its even close.. Local $DmisApp = ObjCreate("PCDLRN.Application") Local $AppEvent = $DmisApp.ApplicationEvents Local $ActivePartProgram = $DmisApp.ActivePartProgram ObjEvent($AppEvent, "Worksheet_","OnStartExecution") While 1 sleep(10) WEnd Func Worksheet_Change() MsgBox("","","yes") EndFunc -
Obtaining the Cell a specific value is in. (Excel)
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
Water, This information puts me on the right track, thanks again for the help! Kruxe -
Obtaining the Cell a specific value is in. (Excel)
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
sorry water, I am still a giant noob, would it be possible to get some example code? thanks! -
Obtaining the Cell a specific value is in. (Excel)
Kruxe replied to Kruxe's topic in AutoIt General Help and Support
Hi Water, Basically i am using one of the examples in the help file and it works great and displays the array showing the cells each occurrence of X is in but how can i extract the cell locations each occurrence is in? #include <Excel.au3> #include <Array.au3> ; Create application object and open an example workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel,"C:\Excel list.xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example", "Error opening workbook '" & @ScriptDir & "\Extras\_Excel1.xls'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf ; Find all occurrences of value "X" (partial match) Local $aResult = _Excel_RangeFind($oWorkbook, "X","N11:N50") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example 1", "Error searching the range." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example 1", "Find all occurrences of value 'X' (partial match)." & @CRLF & "Data successfully searched.") _ArrayDisplay($aResult, "Excel UDF: _Excel_RangeFind Example 1", "", 0, "|", "Sheet|Name|Cell|Value|Formula|Comment") -
Hello Everyone, I was wondering if anyone could offer some help on this. What I am trying to do is search a for a value in an excel range using _Excel_RangeFind which works great but I need to be able to extract what cells the values are found in is there any way to do this? I can see the cells when I use _ArrayDisplay to display the Range but is there a way to actually extra the cell locations? thanks in advanced for the aid! Kruxe
-
Hello Again @Nine bellow is a snippet of the code. Essentially there are 3 scenarios that will trigger the execution of the external app im monitoring. 1st is a keyboard shortcut the second is opening a child window and the third is the one im struggling with because i have to somehow monitor the execution button. I cant just have a mouse click "01" because then any mouse click will trigger the script. what would you suggest? is there anything i can do with ControlGetHandle()? Thanks for your time! Local $control = ("11") Local $Q = ("51") Local $EXECUTE = ControlGetHandle("[CLASS:WilcoxAssociatesIncPC-DMISWndClass]","QuickMeasure","[CLASS:ToolbarWindow32; INSTANCE:5]") While 1 If _IsPressed($control) And _IsPressed($Q) = True Then _CycleStart() ElseIf WinExists("Multiple Execution Wizard") = True Then _CycleStartMulti() ElseIf _IsPressed("01") = true Then _CycleStart() EndIf WEnd
-
Hi All, i was wondering if there is a way to know when a button is clicked by using its handle? I have an application I am monitoring and want my script to fire when a specific button is clicked. i can retrieve the buttons handle buy using ControlGetHandle but am having issues figuring what syntax to use to have the script watch for that handle to be used. I have also tried to use _GUICtrlButton_GetState to get the state of the button but this only ever returns a 0. Can anyone guide me in the right direction? Thanks in advanced!
-
Hey guys, AutoIT noob here, I was wondering if you guys could help me figure something out i have been struggling with for quite some time now. Posted is an example of VB code tasked with listening to an application and performing an action once a specific event takes place in the application. I have tried so many different ways to do the same in Autoit but have had absolutely no luck in grabbing the app events. I was wondering how you guys would go about setting something like this up in autoit and if you could please explain in detail i would really appreciate it! Public Class Form1 Dim PCDApp As PCDLRN.Application Public WithEvents PartEvents As PCDLRN.PartProgram Public WithEvents AppEvents As PCDLRN.ApplicationObjectEvents Dim xlApp As Excel.Application Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load PCDApp = CreateObject("PCDLRN.Application") AppEvents = PCDApp.ApplicationEvents PartEvents = PCDApp.ActivePartProgram End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Start() End Sub Sub Start() ' This is the subroutine to run to start the script Me.Hide() HideExcel() End Sub Private Sub HideExcel() xlApp = CreateObject("Excel.Application") Dim intAnswer As Integer intAnswer = MsgBox("Do you want to make Excel invisible? For this test, you should click Yes. It will become visible when you open a measurement routine.", vbYesNo, "Hide Excel?") If intAnswer = vbYes Then xlApp.Visible = False Else xlApp.Visible = True End If LaunchPCDMIS() End Sub Sub LaunchPCDMIS() PCDApp.Visible = True End Sub Private Sub AppEvents_OnOpenPartProgram(PartProg As PartProgram) Handles AppEvents.OnOpenPartProgram ' Event subroutine. This activates when you OPEN a measurement routine. PartProg = PCDApp.ActivePartProgram xlApp.Visible = True MsgBox("Measurement routine " & PartProg.Name & " opened. Excel should also be visible.") End Sub Private Sub AppEvents_OnStartExecution(PartProg As PartProgram) Handles AppEvents.OnStartExecution ' Event subroutine. This activates when you START EXECUTION of the measurement routine. MsgBox("STARTING EXECUTION OF " & PartProg.Name & ". Click OK to continue.") End Sub Private Sub AppEvents_OnEndExecution(PartProg As PartProgram, TerminationType As Integer) Handles AppEvents.OnEndExecution ' Event subroutine. This activates when you END EXECUTION of the measurement routine. MsgBox("ENDING EXECUTION OF " & PartProg.Name & ". Click OK to continue.") End Sub End Class
-
Local $DmisApp = ObjCreate("PCDLRN.Application") Local $DmisActivePartProgram = $DmisApp.ActivePartProgram Local $DmisCommands = $DmisActivePartProgram.Commands Local $CommandCount = $DmisCommands.Count Local $DmisCommand = $DmisCommands.Item($CommandCount) For $DmisCommand In $DmisCommands If $DmisCommand.Type = "191" Then $Tracefield = $DmisCommand.GetText(258,0) MsgBox("","",$Tracefield) EndIf Next @Nine sorry about that, still very new here. Here you go!
-
Hey Guys! I was hopping I could get some help on this topic, I will try to explain what i am trying to do as clearly as I can! In a nutshell, I am using the API a program and attempting to find all of the "TRACE FIELD" objects within its active page. using the code you see below i can do just that, upon executing the code the For loop will run over and over, going through each trace field and grabbing the text in each one until there are none left. My question is how could I take the text from each instance and save it into either individual variables or one large variable that houses all the data before the look resets and wipes the text from the previous iteration? I hope this made sense, thanks in advanced guys! Kruxe
-
Holy Cow!!! You guys are awesome!!! Thank you so much for all the help i sincerely appreciate it. As someone that is completely new to AutoIT, it feels really good to know that there is such an great community of people willing to help you learn and grow! I will try all of your examples and see what would work best. Again, thanks a ton!!!
- 7 replies
-
- autoit
- copying and pasting text
-
(and 2 more)
Tagged with: