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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upgraded to Office 2010, VBA not working

Status
Not open for further replies.

BenInChicago

Technical User
Jun 18, 2014
4
US
Hi - first time poster. I was recently upgraded from Office 2007 to 2010 and from Attachmate Extra X-treme 9.1 to Attachmate Reflection Suite for X 2011 R2.

The code that I had in Excel 2007 to connect to Attachmate does not work, and I've tried unsuccessfully to surf the internet for the solution. When I run it, it fails [highlight #FCE94F]here[/highlight]

Sub Test_GetPricing()

Dim g_HostSettleTime%
g_HostSettleTime = 50

Dim F_HostSettleTime%
F_HostSettleTime = 50


Dim Sessions As Object
Dim System As Object


Set System = CreateObject("EXTRA.System")
If (System Is Nothing) Then
MsgBox "error1"
Stop
End If
Set Sessions = System.Sessions


' Get the necessary Session Object
[highlight #FCE94F] Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop[/highlight]
End If
If Not Sess0.Visible Then Sess0.Visible = True


I am not trained in VB, so I appreciate any feedback.
Thanks
Ben
 
Hi,

What exactly do you mean by fails?

Errors? Then what error message.

Fails to Set the Session bkect???


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
I get the "Could not create the Session object. Stopping macro playback." pop-up in Excel.
 
Try this...
Code:
Dim Sess0 As Object
Set Sess0 = System.Sessions(1)
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop
If 1 doesn't work try 0.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Using both a 0 or 1, I get:
Run-time error '450':
Wrong number of arguments or invalid property assignment
 
So do you have an Extra Attachmate session open when you run this procedure?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
I can't help you with Reflection. I don't know if the Workspace is a Session. There may be some other Object, like Workspace Object?

What does your HELP say?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top