C# Sourcecode for Excel/COM ProgrammingThis is C sharp sourcecode to provide read, write and create Microsoft Excel Workbooks. List price: $100.00 Complete C# source code with Visual Studio 2005 solution file with royalty free rights to use and modify.This sourcecode provides an object named 'excelhelper'. The sourcecode is developed with the intent to instruct an Excel Workbook in batch mode, completely non-interactive. Use this code to extended your development of C# programs that are already able to contact your databases and other information sources. Here are the public interfaces the object offers:
public bool Command(string op, string spec, string cmd, string value) These public interfaces are straight forward and clean. To note, the GetValues method returns an easy to reference OrderedDictionary, the keys of the collection are in the format "{column}{row}", making it easy to access the data using Column, Row addressing. The Create method is used to open a new workbook, or an existing one. In either case, the workbook returned is available for reading, writing and saving under the same name or a new name. The Command method is the most elaborate and where all of the modification operation are called to. The Command, op statements include:
The code works under the paradigm of active-sheet. All cellrange, column and row commands work on the active sheet for example. Example calls to the addsheet command are:
excelhelper.Command("addsheet","0",null,"Sheet one") // add a sheet at index 0, name it "Sheet one" Example calls to the renamesheet command are:
excelhelper.Command("renamesheet","1",null,"New Name Here") // rename the sheet at position 1 to "New Name Here" Example calls to the delsheet command are:
excelhelper.Command("delsheet","1",null,null) // delete sheet at position 1, aka: sheet 1. Example calls to the copysheet command are:
excelhelper.Command("copysheet","1,0",null,"Sheet new") // copy sheet at position 1, new sheet index is 0, thus shifting the sheets on the copy. Example calls to the cellrange command are:
excelhelper.Command("cellrange","A1,A1","setvalue","Hello World") // sets the value of cell A1 to "Hello World" Example calls to the column command are:
excelhelper.Command("column","A","setvalue","10.00") // set the value of all cells in column A to "10.00" Example calls to the row command are:
excelhelper.Command("row","10","setattribute:Valign","Center") // set the attribute on all cells in row 10, the VerticalAlignment to value "center" The settable attributes currently include:
setattribute:Font values: Normal,Bold,Italic,Underline
Technologies: Deployment/implementation service available. Please use our contact form to inquire. If the object is something that is similar to what you are looking for, your purchase of the sourcecode allows you full modification rights. As well we are interested in providing custom features for your needs. Please inquire for details. DLL-only available at a savings upon request. |