Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extra! - CreateObject VBA Error

Status
Not open for further replies.

JoeZim

MIS
Sep 11, 2003
87
US
I'm a newbie to programming Extra! version 6.2 using Microsoft Excel 2000 VBA. I get my code to work, but keep getting the following error on some occasions when using the program on a given day:

Run-time error '-2147221231 (80040111)'

Automation error - ClassFactory cannot supply requested class


I've used code posted in calculus' FAQ, but keep getting this error.

My code to attach to Extra! is:

Dim Sessions As Object
Dim System As Object
Dim Sess0 As Object

Set System = CreateObject("EXTRA.System")
If (System Is Nothing) Then MsgBox "Could not create the EXTRA System object. Stopping macro playback.": Stop
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then: MsgBox "Could not create the Sessions collection object. Stopping macro playback.": Stop
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then MsgBox "Could not create the Session object. Stopping macro playback.": Stop

I Get the error on:

Set System = CreateObject("EXTRA.System")

Is there something I am missing here? Could this be caused by the version of Extra! (6.2) that I'm working with? Any help would be greatly appreciated.

Joe
 
Yes, in the FAQ it says it's for version 6.5+. The error is being caused because you are trying to create an object for the Extra System, but that object did not exists before version 6.5.

There may be a workaround for you on version 6.2, but I'm not sure what it would be. Start by recording a 1 step macro in Extra. Then copy the code at the top of the macro into VBA. You may have to play with it some, or it may just not work.

Good coding...
calculus
 
Thanks for your reply. I recorded a 1 step macro in Extra. Then copied the code at the top of the macro into VBA and it works again.

This has worked for me in the past, but I was just hoping there was a way to eliminate this step going forward. Some days I don't need to do this, but eventually, I get the error stated above. Any suggestions?

Joe
 
As long as you're using version 6.2 of Extra, you should keep the code you copied in VBA. I don't think you'll have full functionality of the objects, but it will still pilot EB as if the code was in EB. I don't know if I ever worked on 6.2, so you're closer to the details than I am.

Glad you got it to work.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top