Link to home
Start Free TrialLog in
Avatar of rciner313
rciner313Flag for United States of America

asked on

c# Accessing office files without installing office

Can i modify an Excel file located on a network drive using C# if the computer running the program does not have Office installed?
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

What do you mean modify?

It can be opened as any other binary file and read/written to.  

If you want to run Excel commands (eg. automation) then no - you would need excel installed on the PC to do that.
Its pretty hard implement. or you can choose any third party tool such as aspose.
Ex:
http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx
If you plan to automate Excel to edit excel files using the office interop then you have to have excel installed on the computer running the program. You can, alternatively, use C# to create properly formatted XML files that excel will recognize and open up automatically. Here's a good example: http://stackoverflow.com/questions/150339/generating-an-excel-file-in-asp-net
If cost / licensing is the reason why you don't have Office installed, then you might want to try Star Office (free) and try modifying the excel file.

Arun
You can get at the data using an OleDbConnection.
You won't be able to modify the formatting of the document or formulas.
I second the Aspose component. I have been using it for years now and it is a great addition to my toolset.
ASKER CERTIFIED SOLUTION
Avatar of kris_per
kris_per

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial