C# running on citrix, need to get the excel instance running on user desktop

I'm editing a c# program which uses System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") to get the active Excel worksheet and passes Excel.Application object to several functions.

This runs fine when the application is on the desktop, but if it is run from Citrix, it doesn't see the Excel app that is open on the client desktop.  For various reasons we have to access the sheet on the client desktop - they can't run excel in citrix.

Any suggestions as to how to get the Excel.Application object running on the client destop?

Thanks in advance!
LVL 1
iiviitAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ayman BakrSenior ConsultantCommented:
For this then I would suggest to stream the c# executable to the client desktop.
0
iiviitAuthor Commented:
We need to run the executable on Citrix.
0
Ayman BakrSenior ConsultantCommented:
If you run the executable as a hosted app on the server, then it will only be able to call excel application hosted on the same server if available.
0
iiviitAuthor Commented:
If I know the location of the file, which is on a network drive, can I access the spreadsheet that way from Citrix?

(the local app has to open the spreadsheet.   The local app is sending values to the spreadsheet. The Citrix app then has to pick up the data while the spreadsheet is still open and is continually having data added to it for a period of time.)

The current C# program is looking for the excel object and sending that to the function that pulls the object.worksheet data.  Can I access the spreadsheet knowing the network location?  Thanks!
0
Ayman BakrSenior ConsultantCommented:
Let me rephrase to see if I have understood what you want to achieve:

You have a local app on the user desktop which updates data continuously into an excel workbook. You want the c# app on Citrix to continuously retrieve data from that excel sheet. Is this correct?

Well, I don't see a reason why it shouldn't work if you have the workbook on the network share (even if it is on the local PC, you can use the ClientName variable to reach the workbook), but your C# app has to take care of refreshing the workbook for latest updates and also take care that the workbook will be locked for editing by the local app.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.