Jump to content

exodius

Active Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by exodius

  1. I realized that I had the wrong constant for xlCellValue - I should have had 1
  2. Hi, Can someone help me with how to translate this correctly? I've been working on it for a few hours and I just can't quite get it right. Columns("G:G").Select Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _ Formula1:="=""Purchase""" Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority With Selection.FormatConditions(1).Font .Color = -16383844 .TintAndShade = 0 End With With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 13551615 .TintAndShade = 0 End With Selection.FormatConditions(1).StopIfTrue = False I think I'll be fine after the .Add line, I just cannot get it to work. Here's what I've been trying: $oExcel.Selection.FormatConditions.Add(9, 3, "=""Purchase""", '') ;Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""Purchase""" Any help is definitely appreciated!
  3. I should have mentioned, I'm using v3.3.12.0 on Windows 7 64 bit - I have the issue regardless of whether I compile in 32/64 bit.
  4. I have no idea if this is just an issue for me or if anyone can help - Googling the issue didn't yield me much in the way of answers. I have several scripts that are all very dependent on writing to a network drive to collaborate with each other, and I'm surmising that periodically we have a brief network connectivity issue that causes them all to crash. (this is just my theory) When they crash, I get error windows that look like the following. Does anyone have any ideas on any solutions? Or am I just stuck? Thanks! Problem signature: Problem Event Name: InPageError Error Status Code: c000020c Faulting Media Type: 00000000 OS Version: 6.1.7601.2.1.0.256.4 Locale ID: 1033 Additional Information 1: 418d Additional Information 2: 418d79335d4cff81a1979d56f38ebe70 Additional Information 3: fbfc Additional Information 4: fbfc2b6e29523fb831f516cd3c083bea Problem signature: Problem Event Name: InPageError Error Status Code: c000020c Faulting Media Type: 00000000 OS Version: 6.1.7601.2.1.0.256.4 Locale ID: 1033 Additional Information 1: abcc Additional Information 2: abcc8f7853b48d9807d6d51eb1fa5df9 Additional Information 3: abcc Additional Information 4: abcc8f7853b48d9807d6d51eb1fa5df9
  5. Okay, maybe I'm crazy, but is the following an issue with _ArrayMin in version 3.3.12.0 Stable? Or am I just doing something wrong? If I run _ArrayMin against a single item array I don't get any return value back and @error returns as 5 ($aArray is empty) If I run it against a two item array it works fine. #include <Array.au3> Global $aTest[1] $aTest[0] = 1 ;~ _ArrayDisplay($aTest) $vMin = _ArrayMin($aTest) ConsoleWrite("Minimum Value: " & $vMin & @TAB & "@error: " & @error & @LF) Global $aTest[2] $aTest[0] = 1 $aTest[1] = 2 ;~ _ArrayDisplay($aTest) $vMin = _ArrayMin($aTest) ConsoleWrite("Minimum Value: " & $vMin & @TAB & "@error: " & @error & @LF)
  6. I noticed (actually Google Now told me, which is pretty sweet) that AutoIt v3.3.12.0 was just released - I was wondering if SciTE has been updated to match yet or if that's still coming. I noticed on the SciTE download page that it says it was updated on 5/31/2014 and "Definition files included: AutoIt v3.3.10.2 and BETA v3.3.11.5". Thanks!
  7. He's writing a paper - as in the college/university sense where you have to learn/research a subject and then write about it (typically for a grade for a class).
  8. This page probably contains the answer you're looking for, but I guess it depends on what you mean by "supports" http://en.wikipedia.org/wiki/Variant_type
  9. See if this posts helps you: I posted it to show how you can use Access as a medium to script things on SharePoint, but you can probably make it fit your situation.
  10. What exactly do you want to do to that file? You most likely don't need to simulate left-clicking it to accomplish what you want to do.
  11. Try WinGetText or ControlGetText
  12. Try this to see the entirety of your array: _ArrayDisplay($adObj) And try this to see the one element you want (you'll need to change the #'s): MsgBox(0, '', $adObj[3][9])
  13. Well done.
  14. Or use _GUICtrlListView_GetItemText or _GUICtrlListView_GetItemTextArray...
  15. Welcome to the forums! When doing anything in Excel, recording macros is your best friend because it will essentially give you the code - you then just have to convert it to AutoIt's style of COM. Here's an example of how to do what you want to do: #include <Excel.au3> $oExcel = _ExcelBookNew() $oExcel.Range("A1").Select $oExcel.Selection.NumberFormat = "@" ; To set a Text format ;~ $oExcel.Selection.NumberFormat = "0.00" ; To set a Number format _ExcelWriteCell($oExcel, "4/4", "A1") **Note that you need to set the cell format before you write to it, otherwise you end up with something different.
  16. Look at the AutoItX helpfile for MouseClick. You'll find this helpfile in Start --> Programs --> AutoIt v3 --> Extras --> AutoItX --> AutoItX Help File It'll include an example for you to use.
  17. You're welcome, on a side note I believe credit belongs to rasim for the original concept: http://www.autoitscript.com/forum/index.php?showtopic=86734&st=0&p=622039&#entry622039
  18. How about something like this? #include <Misc.au3> #include <GUIConstants.au3> #Include <GuiTreeView.au3> #include <TreeviewConstants.au3> #include <WindowsConstants.au3> #Include <WinAPI.au3> Opt ("GuiOnEventMode", 1) $guiPrinterTool = GUICreate("Printer Tool", 350, 216, Default, Default, BitOR ($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, "_GUI_Event_Close") $tviewPI = GUICtrlCreateTreeView(160, 26, 329, 185, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP), $WS_EX_CLIENTEDGE) $tviewPICon = GUICtrlCreateContextMenu($tviewPI) $tviewPIConInstallAPrinterOn = GUICtrlCreateMenuItem("Install a Printer", $tviewPICon) $tviewPIConchangePrinterName = GUICtrlCreateMenuItem("Change Printer Name", $tviewPICon) $tviewPIConDeletePrinter = GUICtrlCreateMenuItem("Delete Printer", $tviewPICon) $tviewPIConSendTestPage = GUICtrlCreateMenuItem("Send Test Page", $tviewPICon) $tviewPIConSetAsDefault = GUICtrlCreateMenuItem("Set as Default", $tviewPICon) GUICtrlCreateMenuItem("", $tviewPICon) $tviewPIConchangePrinterPort = GUICtrlCreateMenuItem("Change Printer Port", $tviewPICon) GUICtrlCreateMenuItem("", $tviewPICon) $tviewPIConRemoveItem = GUICtrlCreateMenuItem("Remove computer from list", $tviewPICon) $tviewPIConRemoveAllItems = GUICtrlCreateMenuItem("Remove all computers from list", $tviewPICon) GUICtrlCreateTreeViewItem("Test", $tviewPI) $vTest2 = GUICtrlCreateTreeViewItem("Test2", $tviewPI) $vTest3 = GUICtrlCreateTreeViewItem("Test3", $vTest2) GUICtrlCreateTreeViewItem("Test4", $vTest3) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 Sleep (100) WEnd Func _GUI_EVENT_CLOSE() Exit EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) ;~ ConsoleWrite('@@ (' & @ScriptLineNumber & ') :(' & @MIN & ':' & @SEC & ') WM_NOTIFY()' & @CR) ;### Function Trace #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTreeView, $tInfo $hWndTreeView = $tviewPI If Not IsHWnd($tviewPI) Then $hWndTreeView = GUICtrlGetHandle($tviewPI) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndTreeView Switch $iCode Case $NM_RCLICK $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) Local $tPoint, $tTVHEx, $TVhItem, $mX, $mY $tPoint = _WinAPI_GetMousePos(True, $hWndTreeView) $mX = DllStructGetData($tPoint, "X") $mY = DllStructGetData($tPoint, "Y") $TVhItem = _GUICtrlTreeView_HitTestItem($tviewPI, $mX, $mY) _GUICtrlTreeView_SetFocused($tviewPI, $TVhItem) $var = 0 $A = _GUICtrlTreeView_GetItemHandle($tviewPI, $TVhItem) $B = _GUICtrlTreeView_GetParentHandle($tviewPI, $TVhItem) $C = _GUICtrlTreeView_GetParentHandle($tviewPI, _GUICtrlTreeView_GetParentHandle($tviewPI, $TVhItem)) If $C = 0 And $B = 0 Then $vLvl1 = _GUICtrlTreeView_GetText($tviewPI, $A) $vLvl2 = "" $vLvl3 = "" ElseIf $C = 0 And $B <> 0 Then $vLvl1 = _GUICtrlTreeView_GetText($tviewPI, $B) $vLvl2 = _GUICtrlTreeView_GetText($tviewPI, $A) $vLvl3 = "" ElseIf $C <> 0 And $B <> 0 Then $vLvl1 = _GUICtrlTreeView_GetText($tviewPI, $C) $vLvl2 = _GUICtrlTreeView_GetText($tviewPI, $B) $vLvl3 = _GUICtrlTreeView_GetText($tviewPI, $A) EndIf ToolTip ("$A: " & $A & @CRLF & "$B: " & $B & @CRLF & "$C: " & $C & @CRLF & @CRLF & $vLvl1 & @CRLF & $vLvl2 & @CRLF & $vLvl3, 0, 0) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  19. You'll find your answer here: http://msdn.microsoft.com/en-us/library/aa376868%28v=VS.85%29.aspx
  20. If you want to just keep _Func2 from running 20 times because you got antsy, how about something like this? Opt("GUIONEVENTMODE", 1) $vFunc2Ran = 0 GUICreate("", 200, 200) GUISetOnEvent ($GUI_EVENT_CLOSE, "_GUI_EVENT_CLOSE") GUICtrlCreateButton("Button 1", 0, 0, 200, 100) GUICtrlSetOnEvent(-1, "_Func1") GUICtrlCreateButton("Button 2", 0, 100, 200, 100) GUICtrlSetOnEvent(-1, "_Func2") GUISetState() while 1 Sleep(100) WEnd Func _Func1() $returncode = runwait("program.exe") EndFunc Func _Func2() If $vFunc2Ran = 0 Then $vFunc2Ran = 1 MsgBox(0, '', 'Func2 Called') EndIf EndFunc Func _GUI_EVENT_CLOSE() Exit EndFunc
  21. What you're thinking is pretty much the best way to do it, here's an example: #include <IE.au3> #include <Array.au3> _IEErrorHandlerRegister() $oIE = _IECreate ("http://www.autoitscript.com") For $x = 0 to 10000 $oTable = _IETableGetCollection ($oIE, $x) If @error Then ExitLoop $aTableData = _IETableWriteToArray ($oTable, True) If UBound ($aTableData) > 1 Then If StringInStr ($aTableData[1][0], "Back To Top") Then ; Table #4 has Back To Top in element [1][0] _ArrayDisplay($aTableData, "Table #: " & $x) MsgBox (0, "Found it!", "Oh hey look, you found table #4!") ExitLoop EndIf EndIf _ArrayDisplay($aTableData, "Table #: " & $x) Next
  22. Does this help? http://www.autoitscript.com/forum/index.php?showtopic=98002
  23. See if this helps you as an alternative: http://www.autoitscript.com/forum/index.php?showtopic=95026&view=findpost&p=799557
  24. Maybe try something like this? #include <IE.au3> $oIE = _IEAttach ("webpage", "url") $oFrame = _IEFrameGetCollection ($oIE, 1) $oForm = _IEFormElementGetCollection($oFrame, 0) $oSID = _IEGetObjByName($oFrame,"sid") _IEFormElementSetValue($oSID, GUICtrlRead($studentIDBox)) $oInputs = _IETagNameGetCollection($oForm, "input") For $oInput In $oInputs If $oInput.type = "button" Then _IEAction($oInput, "click") _IELoadWait($oIE) ExitLoop EndIf Next
×
×
  • Create New...