connecting to excel on users pc from website

Hello all,

I've built this website project locally in visual web developer express 2010 c#.  Using the 14.0 reference, I connect to the users excel object, open a specific excel file on the desktop, and manipulate it a bit.  All this worked locally, now however I put it up on a host.  And when I test it I get the following error message:

Could not load file or assembly 'office, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified

I've been searching the internet and some links lead me to believe that this can only be used on a desktop.  Not from the web.  Or have excel installed on my server, which I'm guessing is impossible for me since I'm using    What I dont understand is, can't I just look for assembly or load files right from users pc since they have excel installed.

Anyone have any suggestions?

I'm hoping I make sense.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Probably an obvious question. But have you checked that all the .dll files are present in the bin folder?

If I remember right you need the following:
solarissfAuthor Commented:
I have the following in the bin folder

and here is the error message

Source Error:

Line 11:     <compilation debug="true" targetFramework="4.0">
Line 12:       <assemblies>
Line 13:         <add assembly="office, Version=, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
Line 14:         <add assembly="Microsoft.Vbe.Interop, Version=, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
Line 15:       </assemblies>

Source File: D:\Hosting\9179506\html\web.config    Line: 13

Assembly Load Trace: The following information can be helpful to determine why the assembly 'office, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature
It's been a long time since I looked at this side of things. So just had a quick read up on it.

Your assumption about Office appears to be correct, Office PIAs are wrappers for COM based Office components. Without Office components (installed by Office), Office PIAs are useless. From what I understand MS doesn't recommend using server side automation in that way either, so even if you could install Office on the server it is not recommended to do so.

Without knowing exactly what you are doing it is hard to tell you what your best option is from here but I can I recommend you have a look at ADO.NET. The following link may be of use to you:

Read data from Microsoft Excel using Microsoft Visual C# .NET

How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET

How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET

OLE DB Provider for Jet  

Hope this is helpful.
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

solarissfAuthor Commented:
basically this finds the path of the desktop of user, opens a known excel file from it.  Then writes to the excel file, performs some math, and saves as a pdf.

someone recommended created a activex object.  I am trying to understand what an activex object is but from what I'm reading so far, the user will hit allow when launched, then I can use files available on users pc. like

do you know anything about this?  does this sound like a good direction to go in, and if so how do I go about getting started.    or do I head in the previous direction you recommended, ole.ado

thanks so much for the input and advice
I can't say I know much about activex and considering how much of an issue it was getting that dll to show up properly for you in VS I wonder if thats really a dependance you want. It just sounds like trouble to me.

I would have thought it would be easier to have the user upload a file with an upload component and once uploaded process it using, extract data and perform maths etc, then generate a pdf and make it available/return it to the user. (obviously there is more to it than that)

Just my opinion, there are bound to be other ways to do what you are wanting, but after a quick read about access to excel documents server side that would be the direction I would go.

Hopefully that helps a bit, and doesn't confuse the issue even more! Good luck now.
solarissfAuthor Commented:
I've been reading about this online for hours now.  I see other people are taking that approach, to upload file, and process it using    Before I leap into this approach, I do not know what ADO is??   Will I be able to actually open the uploaded the excel file and use normal calculations on it.  For example... I have many formulas on the excel sheet that I rely on, am I still able to access this excel file as if its really open in front of me... or do is it something more like stripping the contents of the excel file into a database and manipulating from there?  because if thats the case then all my formulas I rely on will not be there
It's more like using it as a data source. You should be able to pull the formulas from the cells in the sheet, but you won't be able to run them like they are in front of you.

I'm still not 100% sure about what you are trying to achieve. Is a web app definitely the right approach?
solarissfAuthor Commented:
It looks like I am going about this the wrong way.  I guess I just have to read the data from excel... then perform all my statistical calculations another way.  But the goal is to show results on website.  If I skip doing the calcs in excel, how would you recommend I read excel sheet, and where would I perform my math?
If you are just pulling data out then using ADO.NET to connect to excel would make sense. This is much the same as connecting to say an access database. You can pull data from your sheets.

Where you do calculations really depends on what you are doing with your data, if all you want to do is perform some calculation and then show the results then this should be fine to do the math in code. How difficult this will be depends on how much you manipulate the numbers etc.
solarissfAuthor Commented:
sorry for the dumb question, but what different options do I have to perform calculations?  some of the things I need are pretty easy, like average performance.. standard deviations.  correlations.  some get a bit more complicated like calculating cumulative rate of returns and building portfolios.
You can pull the data into memory and run maths functions on it. You could bind it into a datagrid type control and perform calculations on that. You could even perform calculation on the excel data and push the results back into the excel worksheet.

There are lots of ways to manipulate data.

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.