Sign in to follow this  
Followers 0
GMK

Problems with ObjGet

1 post in this topic

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?

Share this post


Link to post
Share on other sites



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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • WoodGrain
      By WoodGrain
      Hi All,
      I've coded the small script below, but it can't seem to get the instance of Windows Media player as it keeps going to @error, I've not used com objects before so any assistance would be appreciate. I already have WMP open and minimised. I retrieved "WMPlayerApp" from the AutoIT info tool, I've included a copy below.
      I'm using these sources:
      https://msdn.microsoft.com/en-us/library/dd564085.aspx
      https://msdn.microsoft.com/en-us/library/dd564018.aspx
      $oWMP = ObjGet("", "WMPlayerApp") If @error Then MsgBox(0, "Can't get WMP", "Couldn't connect to the WMP instance") Exit EndIf $wmpPlayState = $oWMP.playState MsgBox(0, "Play State", $wmpPlayState) $wmpSongName = $oWMP.currentMedia.name MsgBox(0, "Play State", $wmpSongName) I've also seen references to the below, but I want to get an existing open WMP:
      ObjCreate("wmplayer.OCX") and have looked at the WMP.udf but can't see how it will do either of the functions I've coded above.
       
    • kingjacob90
      By kingjacob90
      HI
      I am wanting to know what my CPU temp is but don't know what object to use. I don't relay know how objget works so would not know where to start. I have seen people integrate things like windows speech to text into their scripts but don't know how they know what object to use! How do I find the right object? And how dose it work?
       
      Thanks Jacob
    • jaja714
      By jaja714
      For years, I have been running a script using ObjGet to open an Excel workbook but, after upgrading from Win7 to Win10, ObjGet is now returning with an error.  The only way I can get it to work on Win10 is to actually open the workbook manually myself and then run the script.
    • Tjalve
      By Tjalve
      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) Exit But 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) Exit And 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 EndFunc The 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
    • souldjer777
      By souldjer777
      Good Morning Everyone and Happy Friday!
      First - of course: Thanks to everyone in AutoIT - You help systems administrators and programmers everywhere get help to folks that need it with fluid automation I can personally say that you've helped literally thousands of people I've distribute exe's too. Amazing work, you've saved so many of us all time, redundancy and pain. You've quite honestly given many folks their time back... 

      On with the questions then...
      Having real trouble getting this OutlookEX UDF to work... getting "Error creating a connection to Outlook. @error = 1, @extended = -2147221164"
      I see from previous issues that means
      "The error code stands for '80040154 Class not registered'.
      Means: The class is unknown to the user running the script. I assume you use the system account to run the script in the task scheduler?"
      I'm running the script from SciTE
      #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #RequireAdmin #include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Example 1 ; Send a html mail to the current user. ; Add an attachment and set importance to high. ; ***************************************************************************** Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_Wrapper_SendMail($oOutlook, $sCurrentUser, "", "", "TestSubject", "Body<br><b>fett</b> normal.", @ScriptDir & "\_OL_Wrapper_SendMail.au3", $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) Using Windows 7 x64 and Outlook 2013.
      Thanks Everyone!
      Also... getting error...
      Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name
      Global $sCurrentUser = $oOutlook^ ERROR
      ...using the following sample code taken from this forum.
      #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=N #include <File.au3> #include <GUIConstants.au3> #include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <GUIToolTip.au3> #include <Array.au3> #include <Constants.au3> #include <Date.au3> #include <WinAPIFiles.au3> #include <ScreenCapture.au3> #include <OutlookEX.au3> #include <WinAPIFiles.au3> Global $iFileName, $Form1_1 Global $oOutlook = _OL_Open() GLobal $sTo = "emailaddress@gmail.com;" $Form1_1 = GUICreate("System Information", 1083, 638, 182, 114) GUISetState(@SW_SHOW) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) $iFileName = @DesktopDir & "\Utility Screenshot - " & @MON & "." & @MDAY & "." & @YEAR & " - (" & @HOUR & "." & @MIN & "." & @SEC & ").jpg" _ScreenCapture_CaptureWnd($iFileName, $Form1_1) Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name _OL_Wrapper_SendMail($oOutlook, $sTo, "", "", "Configuration Utility Screenshot", "Attached please find the Configuration Utilty Screenshot.<br>Automatically sent via the Configuration Utlity<br>Thank you, <br>" & $sCurrentUser, $iFileName, $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) *** I have a separate login for MS Outlook 2013 because I have multiple ID's *** Do I have to run it as the current mailbox user???
      Thanks again!