Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Thmos01 Contributor.
Contributor.
193 views

.Type micALT + micF4 does not work in Citrix machine

When I run the following code to test Excel open and close.

I received an error reading "Microsoft Excel has stopped Working." in my Citrix machine.

While the code works in desktop or VM machines.

Any ideas and help. Much appreciated.

 

Set objDesc = Description.Create         

objDesc("name").Value = ".*Excel"        

 objDesc("fast_query").Value = "1"         

objDesc("nativeclass").Value = "XLMAIN"

 SystemUtil.Run "EXCEL.EXE", "","","OPEN", 3     

wait 3          

Set objCollection = Desktop.ChildObjects(objDesc)         

Print "["& Now &"] object win collection count <"& objCollection.Count &">"             

For intNdex = 0 To objCollection.Count - 1                          

Set objWin1 = objCollection.Item(intIndex)             

Print "["& Now &"] object found name <"& objWin1.Name &">"     

Next          

objWin1.setfocus     

objWin1.highlight         

 For each strCmd in arrKeySequences                                              

             Execute "objWin1.Type " & strCmd : wait 2    

 Next

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: .Type micALT + micF4 does not work in Citrix machine

Hi!

Which version of Citrix do you have? and which version of UFT as well?

In which part the script is failing? |If yo urun the code on a .vbs file excel crashes as well?

Looking forward to you rupdate.

Regards

0 Likes
Thmos01 Contributor.
Contributor.

Re: .Type micALT + micF4 does not work in Citrix machine

Thanks fpr ypur rely.

My Citrix version is 7.15 and UFT 14.02.

Excel Error (popup) : "Microsoft Excel has stopped working" appear after the execute line is performed.

This piece of code involves object recogition. Do you think it can be run independently without UFT or UFT runtime.

Let me know if you know a way to run it? The code works when running it in a machine without Citrix.

looking forward to hear idears from you again

0 Likes
Thmos01 Contributor.
Contributor.

Re: .Type micALT + micF4 does not work in Citrix machine

 Please note this line is missing from the avove script.

 arrKeySequences = Array("micAltDwn + micF4 + micAltUp")

It should be before the Loop that contains the Execute statement, like:

 arrKeySequences = Array("micAltDwn + micF4 + micAltUp")

For each strCmd in arrKeySequences                                              

             Execute "objWin1.Type " & strCmd : wait 2    

 Next

0 Likes
Knowledge Partner
Knowledge Partner

Re: .Type micALT + micF4 does not work in Citrix machine

You should drive Excel via the COM object

VBScript

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\Test.xls")


i = 1


Do Until objExcel.Cells(i, 1).Value = ""

    If objExcel.Cells(i, 1).Value = "delete" Then

        Set objRange = objExcel.Cells(i, 1).EntireRow

        objRange.Delete

        i = i - 1

    End If

    i = i + 1

Loop

Powershell

https://4sysops.com/archives/read-and-write-excel-spreadsheets-with-the-importexcel-powershell-module/

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.