Question

I have excel file and when button click I need to open the default browser in CITRIX. I can open the citrix. But when I open the browser it opens in local PC.

To open citrix I have used following code.

strPath1 = "C:\Program Files\Citrix\ICA Client\pn.exe /APP MYCTX08"
r1 = Shell(strPath1)

To open browser I have used following code

Declare Function ShellExecute _
                        Lib "shell32.dll" _
                        Alias "ShellExecuteA" ( _
                        ByVal hwnd As Long, _
                        ByVal lpOperation As String, _
                        ByVal lpFile As String, _
                        ByVal lpParameters As String, _
                        ByVal lpDirectory As String, _
                        ByVal nShowCmd As Long) _
                        As Long


 r = ShellExecute(1, "open", "my_link", 0, 0, 1)

If you have any workaround for this that would be really appreciate. Thanks in advance.

Was it helpful?

Solution

I got a workaround for this.

Step I

Create a ICA connection using CITRIX Program Neighborhood. Give a name whatever you want. Ex:MYCTX08

Step II

Right click on the newly created connection(MYCTX08).
Go to Properties and click on Application tab

In the Application text box type following

firefox.exe  -P -no-remote "YourLink"  

In the Working Directory text box, give the path to directory

C:\Program Files\Mozilla Firefox

(above is the path to firefox.exe)

Then use following VBA code to open the link on firefox in CITRIX.

strPath1 = "C:\Program Files\Citrix\ICA Client\pn.exe /APP MYCTX08"  
r1 = Shell(strPath1)  

Important things to know.

  • You will only be able to see the given application on the CITRIX.
  • When you close the application CITRIX window will be automatically closed.
  • If you have already opened the Firefox in CITRIX. This will give the notice like your firefox is already running blah blah

If you want to open new profile of firefox. You can use the following command in Application text box in Step II

firefox.exe  -P "YourNewlyCreatedFirefoxProfileName" -no-remote "YourLink"  

Please note that you can use above procedure to open any application in CITRIX using VBA.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top