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

VB6 doesn't work for Citrix based software.

Status
Not open for further replies.

xlStar

Technical User
Nov 16, 2003
55
0
0
GB
I have a VB6 program which work for years until recently my company has moved from PCs to Citirx Environment using WYSE terminals (we no longer have PC now).

This means that all the software are installed centrally on a server instead of C:\ drive (base PC).

Unfortunately this has upset the VB6 program which was written by ex-colleague; this is the extract of the codes that doesn't work on Citrix environment but works on PC..


Private Sub Command1_Click()
Dim pExcel As Excel.Application

Set pExcel = GetObject(, "Excel.Application")
If pExcel Is Nothing Then
GoTo Err
End If

pExcel.Visible = True

Exit Sub
Err:
MsgBox "Error - Can't find Excel"
End Sub


The macro stopped at "Set pExcel = GetObject(, "Excel.Application")" with the error message of "runtime error 429 activex can't create object"

I have searched all over google for the solution but no avail. They all said you need Excel on C:\ but provided no alternative VBA codings for Citrix.

If it any help, the CITRIX boot drive is on drive Z although we can not able to expand the subfolders/files from this drive.

Basically I need to get opened Excel with the reference to drive Z and not C. I am not part of IT department by the way.

Can anybody help?
 
Could be as simple as the server having a different version of Office on it than the program was compiled against. Try using late binding instead.
 
>Set pExcel = GetObject(, "Excel.Application")

will only run without error if an instance of Excel is already running in the current user's OS session, that will be the case on a standalone PC or in a Citrix session.

To start a new instance of Excel you should be using

Set pExcel = CreateObject("Excel.Application")

You could consider using something like;

On Error Resume Next
Set objXl = GetObject(, "Excel.Application")
If Err Then Set objXl = CreateObject("Excel.Application")
On Error GoTo 0

The actual path to Excel's program files hould not affect your code; the os should lookup that information automatically via the registry when you use the string "Excel.Application" in the above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top