Jump to content
Sign in to follow this  

type of Object

Recommended Posts


Hi -

I am trying to create a trade bot for MTGO. I am using an example script I found here as a template for this project. However when I run the script I get to a certain spot and I get an error I am not familiar with: Variable must be of type "Object".

Here is the portion of the script file that gives the error:

$miDoc = ObjCreate("MODI.Document")

$miDocView = ObjCreate("MiDocViewer.MiDocView")

$Viewer = GUICreate("Embedded MODI Viewer", 640, 580, (@DesktopWidth-640)/2, (@DesktopHeight-580)/2)

GUICtrlCreatePic($sTargetImage, 320, 290, 0, 0)

GUICtrlSetResizing($Viewer, $GUI_DOCKAUTO)



$MiDocView.Document = $miDoc


In particular the line: $MiDocView.Document = $miDoc

gives the actual error.

can anyone help me solve this?


Share this post

Link to post
Share on other sites

I thought I'd grab the error from the error box:

$MiDocView.Document = $miDoc


Error: Variable must be of type "Object".

Share this post

Link to post
Share on other sites

Question: So what variable is the error pointing to? Answer: $MiDocView

Is it an object? Examine IsObj($MiDocView)

You are trying to get the .Document property of $MiDocView and you'll find that it is not an object.

Why is it not an object? because ObjCreate("MODI.Document") failed

you didn't know that ObjCreate("MODI.Document") failed because you didn't check to see if @error was set or if it returned an object

Why did the ObjCreate fail? Check prerequisites and the existance and registration of the proper files on your system

until the ObjCreate succeeds, you can go nowhere with your code.


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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