VB Script/VBA

Advertisement


Question
I have declared an object variable for a class and instantiated. When a use a method available in the declared Class of the object variable, it gives an error message saying GET Method Failed.

Let me attach the code and the error message here with this mail below.

Dim Temp As XSCRIPTINGHOSTLib.ScriptItemDialog

-------------------------------------------------

Sub EntryLevelMacro()

Set Temp = New XSCRIPTINGHOSTLib.ScriptItemDialog

Temp.MessageBox "Info", "Show this message"

Set Temp = Nothing

End Sub

-------------------------------------------------


Error Message :

Run-time error '2147220604(80040384)':

Method 'MessageBox' of object 'IScriptItemDialog' failed

Answer
Sorry, I don't have that object on my system.  What application is it refered to?

Also, what is the context where you are programming?  For example, in VBA there is a msgbox function that can do what you need:

Sub EntryLevelMacro()
  MsgBox "Show this message", , "Info"
End Sub

Miguel.

VB Script

All Answers


Answers by Expert:


Ask Experts

Volunteer


Miguel Zapico

Expertise

I can answer question about how to use scripts to consolidate data, connect different systems and automate tasks. I have no experience on using VBScript on web programming.

Experience

I have been using VBScript and Windows Scripting Host as my swiss tool for the last 6 years.

Organizations
New York PC users group (NYPC)
Independant Computer Consultants Association (ICCA)

Education/Credentials
Microsoft MCSE in Windows NT

©2012 About.com, a part of The New York Times Company. All rights reserved.