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!

Attachmate with Citrix

Status
Not open for further replies.

dam0612

Technical User
Apr 22, 2008
5
GB
Hi,

The company I work for has started using the Citrix platform and Extra has moved across to be used through Citrix. Now, when trying to call Extra I get an error saying activex can't create the object and the debug shows the error on the line trying to call Extra. I assume I need to add some code in to fix this problem?

Thanks
 
Can you post your code? Are you maybe using the getobject function without Attachmate open?
 
Hi, thanks for the reply. Extra is open when the macro is run.

Here is the code I am using:

Code:
'Get details from Excel
    dod = Range("D6"): If dod = "" Then MsgBox ("Please input Date of Death and try again"): End
    dod = Format(dod, "DD/MM/YYYY")
    Range("F8, F10").Select
    Selection.ClearContents
    
' Get the main system object
    Dim Sessions As Object
    Dim System As Object
    Set System = CreateObject("EXTRA.System")   ' Gets the system object
    If (System Is Nothing) Then
        MsgBox "Could not create the EXTRA System object.  Stopping macro playback."
        Stop
    End If
    Set Sessions = System.Sessions

    If (Sessions Is Nothing) Then
        MsgBox "Could not create the Sessions collection object.  Stopping macro playback."
        Stop
    End If
    
    
'--------------------------------------------------------------------------------
 '  Set the default wait timeout value
        g_hostsettletime = 1500

    OldSystemTimeout& = System.TimeoutValue
    If (g_hostsettletime > OldSystemTimeout) Then
        System.TimeoutValue = g_hostsettletime
    End If

' Get the necessary Session Object
    Dim Sess0 As Object
    Set Sess0 = System.ActiveSession
    If (Sess0 Is Nothing) Then
        MsgBox "Could not create the Session object.  Stopping macro playback."
        Stop
    End If
    If Not Sess0.Visible Then Sess0.Visible = True
    Do While Sess0.Screen.OIA.Xstatus <> 0
                DoEvents
                    Loop
    
' This section of code contains the gubbins
Dim Sys As Object, Sess As Object, MyScreen As Object, MyArea As Object
Dim ScrnChk As String, scrnchk1 As String, ScrnChk2 As String, PFKey As String

Set Sys = CreateObject("EXTRA.System")
Set Sess = Sys.ActiveSession
Set MyScreen = Sess.Screen

I get the debug on the line

Code:
Set System = CreateObject("EXTRA.System")   ' Gets the system object

Thanks
 
Are you running the code in Excel?
Maybe you have a misconfigured path problem.
1-In the windows work area, right-click in 'my computer'.
2-Select the advanced tab
3-Click the 'system variables' button
4-In the user variables region, create a variable named 'Path' with the value 'C:\Program Files\E!PC' (the Path do Extra! folder)
 
Hi

Thanks for the reply.

Yes, I am running it from excel.

The company I work for has disabled the functionality to add new variables. However, there is one in there called path already, can't see the full path but it begins 'C:\Programs\Oracle\Product\10.1.0....'. Would this seem like what we are looking for? I could call our IT team to get the rest of the info. How then do I solve this problem?

Many thanks for your help.
 
If you have the Extra! in you computer, I suppose in the folder C:\Programs\E!PC, you must edit the variable 'Path' and include 'C:\Programs\E!PC' in the path, including a ';' to separated of other content of the variable.
If the 'Path' variable already exists, for example, with the content 'C:\Programs\Oracle\Produt\10.1.0.0', change the variable to
'C:\Programs\Oracle\Produt\10.1.0.0;C:\Programs\E!PC'

I hope this tip will help you.
 
I almost forget, you have to reboot the computer to the changes in the variables make any effect.
 
Actually, it sounds like Extra! is NOT being run from the local computer, but from the Citrix platform. My guess is you are still running Excel from the local computer. In order to get this to work, you will need to run both programs from the same platform (either both from the local computer or both from Citrix).
 
Hi

thanks fopr your help.

I was given some code from our IT guys and basically I have to create a macro in Extra and get it to run from extra instead of running frmo excel.

Code:
' Global variable declarations
Global g_HostSettleTime%

Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
	Dim Sessions As Object
	Dim System As Object
	Set System = CreateObject("EXTRA.System")	' Gets the system object
	If (System is Nothing) Then
		Msgbox "Could not create the EXTRA System object.  Stopping macro playback."
		STOP
	End If
	Set Sessions = System.Sessions

	If (Sessions is Nothing) Then
		Msgbox "Could not create the Sessions collection object.  Stopping macro playback."
		STOP
	End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
	g_HostSettleTime = 200		' milliseconds

	OldSystemTimeout& = System.TimeoutValue
	If (g_HostSettleTime > OldSystemTimeout) Then
		System.TimeoutValue = g_HostSettleTime
	End If

' Get the necessary Session Object
	Dim Sess0 As Object
	Set Sess0 = System.ActiveSession
	If (Sess0 is Nothing) Then
		Msgbox "Could not create the Session object.  Stopping macro playback."
		STOP
	End If
	If Not Sess0.Visible Then Sess0.Visible = TRUE
	Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
                Dim wrd As Object         
Set wrd = CreateObject("Word.Application")
wrd.Visible = True
	        Dim xlApp As Object	' Declare variable to hold the reference.
        Set xlApp = CreateObject("excel.application")
        Dim Polno, GrNo As String
        xlApp.Visible = True
        xlApp.Workbooks.Open FileName:="\\RGTHEPPDT35\Data_lp_custserv\RP Folder\Servicing\Tools\RP Policy Details Tool v3.9.xls"
        
                    MsgBox "Fill the necessary details and click OK"
                    
                    xlApp.run "'RP Policy Details Tool v3.9.xls'!PrintLetter.printletter"
                   
                    
End Sub

Its a pain in the neck though, I'd really much rather be running it from excel!

 
Have you tried opening Excel from within Attachmate? We had a similar situation where a cookie file had to be accessed from a macro. When IE was opened from Attachmate, the cookie was created on the same server that was running Attachmate and everything worked fine.

You may find that by creating a simple macro to open an Excel shell while Attachmate is running in Citrix, the Excel macro may successfully communicate with your Attachmate session.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top