INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

(OP)
Hello,

Did anyone encountered and had a solution when trying to bind the Reflection Workspace 2014 in Excel VBA. I'm getting an error when creating a object. Saw a post on the related subject by sharonniles, however didn't saw the issue was resolved. here is the code below. Please help.

Dim oTerminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.ibmTerminal
Dim oApp As Attachmate_Reflection_Objects_Framework.ApplicationObject
Dim oFrame As Attachmate_Reflection_Objects.frame
Dim oView As Attachmate_Reflection_Objects.view

Set oApp = New Attachmate_Reflection_Objects_Framework.ApplicationObject
If (oApp Is Nothing) Then
MsgBox "Unable to create Attachmate Workspace Application", vbCritical, "Application Workspace Error"
GoTo Obj_Release
End If

Set oFrame = oApp.GetObject("Frame")
If (oFrame Is Nothing) Then
MsgBox "Unable to create Attachmate Workspace Frame", vbCritical, "Workspace Frame Error"
GoTo Obj_Release
End If

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

Hi,

Do you have a reference set to a Attachmate Reflections Object Library in your Excel VBAProject?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

(OP)
Hi Skip.
Thank you for looking into this.
Yes I do. Also, i have it installed.
It's already been a week and couldn't resolve this.

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

http://docs.attachmate.com/reflection/16-1/vba-pro...

According to this link, you need FOUR Attachmate Reflections libraries to be referenced in Excel VBA.

Did you do this as well?

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

(OP)
Hi Skip. Yes, I had all that referenced also but still error is prompting that Active X can't create the object.

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

Use CreateObject() to create the application object.

Caveat:
I am not an Attachmate Reflections user and never have been.

I am a former Attachmate Extra (AE) user. But I have done 99.99% of my AE coding in Excel VBA and I understand object concepts and working asynchronously with a terminal emulator.

If it helps any, here's the code I used to create an Attachmate System object (seems like its the application object...)

CODE

Public oSystem As ExtraSystem
Public oSess As ExtraSession
Public oScrn As ExtraScreen

Sub IMS_Login()

    Dim result, bLogin As Boolean
    
    Set oSystem = CreateObject("Extra.System")
    
    If oSystem.Sessions.Count = 0 Then
        Set oSess = oSystem.Sessions.Open("C:\Program Files\E!PC\Sessions\Mainframe.edp")
    Else
        Set oSess = oSystem.ActiveSession
    End If
    
    With oSess
        .Visible = True
        .WindowState = xNORMAL
    End With

    Set oScrn = oSess.Screen
    If (oScrn Is Nothing) Then GoTo ExitMacro
    
    oSystem.TimeoutValue = 100
    
    With oScrn
        If bLogin Then
        ' BHT SignOn
            Do Until .WaitForCursor(17, 28)
                DoEvents
            Loop
            .Area(17, 28, 17, 28) = "S"
            .SendKeys ("<ENTER>")
        ' Login
            Do Until .WaitForCursor(14, 37)
                DoEvents
            Loop
            .Area(14, 37, 14, 46) = fOSUserName()
            .Area(15, 37, 15, 46) = vPassword
            .SendKeys ("<ENTER>")
        ' SuperSession
            Do Until .WaitForCursor(9, 2)
                DoEvents
            Loop
            .Area(11, 2, 11, 2) = "S"
            .SendKeys ("<ENTER>")
        ' IMS Ready
        End If
    End With

'...Macro Magic happens here...

ExitMacro:
    If bContinue Then Exit Sub
    Set oScrn = Nothing
    Set oSess = Nothing
    Set oSystem = Nothing
End Sub 

So for Reflection, maybe this...

CODE

Dim oSess as Reflection.Session
Set oSess= CreateObject("Reflection.Session") 


Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

(OP)
Thank you Skip for sharing. I also tried this. Using creatobject and getobject approach. But still getting the same error. I also created some macro before using attachmate extra like the one you shared above with no problem. Seems this attacmate reflection is giving me a hard time. I saw last year post with same problem by sharonniles. Am hoping she'found a solution. Would you know how to reach her?

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

Cannot make that contact.

Plz post the code that you tried with CreateObject.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

(OP)
Here it is. As mentioned in the Help files.

Set oApp = CreateObject(Reflection Workspace)
If (oApp Is Nothing) Then
MsgBox "Unable to create Attachmate Workspace Application", vbCritical, "Application Workspace Error"
GoTo Obj_Release
End If

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

Hi,

Hmmmmmmm. Where's Workspace???

http://docs.attachmate.com/reflection/14.0/vbug.pd...

Here's what it seems to me. "Workspace" is a display thing, when you're working in Reflection.

However, you have stated that you'r running Excel usung VBA. What do you care what the workspace looks like? You just want to get data to get from Excel to your mainframe and data from your mainframe to Excel.

FORGET WORKSPACE!

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

...and from the Attachmate Reflection Workspace site...

Quote:

You can customize the Reflection workspace to control its appearance and behavior or to lock down access to Reflection settings and controls.
...none of which, if I understand your intent, will affect data acquisition to or from the mainframe system.

http://docs.attachmate.com/reflection/16-1/vba-pro...

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: VBA EXCEL ActiveX Component Can't Create Object in Reflection Workspace

(OP)
Hi Skip,

I'm sorry was out for days. but here's what I understand. in order to access the frame I need to get the application itself by doing this.

Set oApp = New Attachmate_Reflection_Objects_Framework.ApplicationObject
or
Set oApp = CreateObject("Reflection Workspace")

however, none of this works.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close