Search the Community
Showing results for tags 'com error'.
-
Hi Everyone. Im currently coding script for a BI Tool called Qlikview. Qlikview has a COM API that i use to get data and to manipulate the tool in verius ways. The script in itself is an compiled EXE that can do diffrent tasks depending on what input is put into a txt file. And when this input is entered in the wrong way, the script throws a COM errror. This usually is easy fixed with a COM error handler. But for some reason it wont work im my partucilur case. I have put the most frequently used QV functions into a UDF witch i call upon in the main script. And when there is a COM error in the main scipt, it works. But when the error is in the UDF (an included au3 file) the COM error handler wont catch the error and the script crashes. I run this. It works and i get a MSGbox from the COM error handler. The reason for the failiure is that the field "Formfaktor2" does not exists. $object_qv = _qv_open(1) $o_document = _qv_opendocument($object_qv,"C:\Users\xxxxxx\Documents\Qlikview\xxxxxxx.qvw") ;~ $loop = _qv_field_GetPossibleValues($o_document,"Formfaktor2",$nr_of_returns) $values = $o_document.Fields("Formfaktor2").GetPossibleValues(300) local $array[$values.count + 1] $array[0] = $values.count for $i = 0 to $values.count - 1 $array[$i+1] = $values.Item($i).Text Next _ArrayDisplay($array) ExitBut if i run this: $object_qv = _qv_open(1) $o_document = _qv_opendocument($object_qv,"C:\Users\xxxxxx\Documents\Qlikview\xxxxxxxxx.qvw") $loop = _qv_field_GetPossibleValues($o_document,"Formfaktor2",$nr_of_returns) ExitAnd in the UDF i have this function (same code as above). But then i get "The requested action with this object has failed.:" on the first row in the function. func _qv_field_GetPossibleValues($qv_documentobject,$field,$numberofreturns=100) $values = $qv_documentobject.Fields($field).GetPossibleValues($numberofreturns) local $array[$values.count + 1] $array[0] = $values.count for $i = 0 to $values.count - 1 $array[$i+1] = $values.Item($i).Text Next return $array EndFuncThe Only difference is that the secound code runs in my UDF isnterad of the main script. But the COM error handler should pick it up anyway. Does anyone jhave any idees? Thansk for your time
-
Hi guys, without including everything (unless you want it) I am copying data from a table in chrome and wanting to paste it into excel. Copying in Chrome works. I can paste it into the field i want by emulating goto -> ctrl V: WinActivate($dataload) WinWaitActive($dataload) Sleep(500) $oWorkbook1.Sheets("ItemReturn").Activate Sleep(500) $msg = "Measuring Sheet" conwrite() ttips2() Local Const $xlUp = -4162 With $oWorkbook1.ActiveSheet ; process active sheet $oRangeLast = .UsedRange.SpecialCells($xlCellTypeLastCell) ; get a Range that contains the last used cells $iRowCount = .Range(.Cells(1, 1), .Cells($oRangeLast.Row, "B")).Rows.Count ; get the the row count for the range starting in row/column 1 and ending at the last used row/column $iLastCell = .Cells($iRowCount + 1, "B").End($xlUp).Row ; start in the row following the last used row and move up to the first used cell in column "B" and grab this row number EndWith $NewStartCell = $iLastCell + 2 $msg = "moving to location" conwrite() ttips2() Sleep(250) Send("^g") WinWait("Go To") Sleep(100) Send("B" & $NewStartCell) Sleep(100) Send("{ENTER}") Sleep(500) Send("^v") But, I want to use _excel_rangecopypaste, pasting from the clipboard _Excel_RangeCopyPaste($oWorkbook1.ActiveSheet, default, "B" & $NewStartCell,default,$xlPasteValuesAndNumberFormats) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeCopy Example 2", "Error pasting cells." & @CRLF & "@error = " & @error & ", @extended = " & @extended) however, this gives me error 4 , extended@: -2147352567 How can i fix this or find out how to debug this error? Thanks
-
Before upgrading to AutoIt v.3.3.10.2, I had no problems using ObjGet, but now I get a "0x80020006 Unknown name" COM error. I'm running Windows 7 and the object to which I'm trying to attach is PowerTermPro.Document, which worked fine previously, but not so much now. 1. Does anyone know why this error would occur and how to fix it? 2. Also, are there any tools available to see which objects are available in the running object table (ROT) and possibly see their ProgID and/or CLSID?