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!

Switch to Citrix causing macro error

Status
Not open for further replies.

blckngldhwk

Technical User
Feb 14, 2008
46
US
Recently our company started rolling out Citrix desktop clients to some of our employees in place of actual PCs. Would this change cause an error in the following code? The problem is only occurring with those who have switched to the Citrix client. Thanks!

Code:
        Dim Sys As Object, MyScreen As Object, MyArea As Object, objIE As Object, i as Integer
        
        Set MyScreen = Sess.Screen
                
        elchk$ = myscreen.getstring(36,27,04)
        elchk = elchk$
            
        If elchk = "ELIG" then
        
        Else
        
          Sess.Screen.Sendkeys("<pf12>")
          g_HostSettleTime = 250		' milliseconds
          Sess.Screen.WaitHostQuiet (g_HostSettleTime)
               
        End If
        
        Covcod$ = myscreen.getstring(40,11,03)
        covcod = covcod$
        
        grpnum$ = myscreen.getstring(39,06,05)
        grpnum = grpnum$
        
        bu$ = myscreen.getstring(39,11,04)
        bu = bu$
               
        Set objIE = CreateObject("InternetExplorer.Application")

        With objIE
        
           .Visible = True
           .Navigate "internal web address"
      
        End With
        
        While objIE.Busy
      
          DoEvents
        
        Wend
   
        objIE.Document.All("txtcovcode").Value = covcod
        objIE.Document.All("txtgroupnum").Value = grpnum
        objIE.Document.All("txtgroupbu").Value = bu
        
        objIE.Document.All("btnsearchnow").Click
   
End Sub

I'm getting an error on the objIE.Document.All... lines. Says 'Object Error, Line Number: 101'. Any thoughts?
 
Clarification. When the macro runs it opens a blank IE window and then the macro errors at line 104 because the page doesn't load. When I close the blank IE window it will then open up the internal page in a new window. So rather than just opening and navigating to the page, it opens a blank windows, errors, then you close that window and THEN it opens a window to the internal page.
 
We have similar issues with Citrix at my Comp. Most likely, or least likely as this is only a guess, is that the user does not have commandline level permissions. Even though the script is sending the command, the user's security profile on the new Citrix server determine the access. I got around this issue by accessing Citrix and then establishing a Remote Desktop Connection to the same or a different Citrix server. This allows more access and it retains you profile and settings between logins. Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top