|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
OK. Add a reference to Microsoft Office. Then import the namespace. Then, create a new variable and call it "app" like so: Code:
Excel.Application app = new Excel.Application(); |
|
|||||
|
Code:
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWB;
Excel.Worksheet xlWS;
Excel.Range xlRng;
string workbookPath = "C:\\Documents and Settings\\adavis\\My Documents\\Area51\\T-Numbers Data";
private void addTNumberBtn_Click(object sender, EventArgs e)
{
xlApp.Workbooks.Open(workbookPath, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
int colIndex = 0;
string addTNumbers = addTNumberTextBox.Text;
xlWS.Cells[1, 1] = addTNumbers;
//Save the file to where you specified
xlWB.Save();
xlApp.Visible = true;
}
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excel Automation | Xystus777 | C# Programming | 1 | 11-14-2008 12:48 PM |
| using VB with excel | renoald | Visual Basic Programming | 26 | 10-20-2008 11:52 AM |
| Import from excel to Sql in VB.NET? | Borin | Visual Basic Programming | 3 | 08-18-2008 06:21 AM |
| export to excel problem with IPAddress in URL but working with localhost url | mustaque | ASP, ASP.NET and Coldfusion | 5 | 08-04-2008 07:31 AM |
| Help on Excel sheets!!!!!!!!! | sania21 | Visual Basic Programming | 2 | 07-02-2007 05:41 AM |
Algorithms and Data Structures
Programming Language Popularity
Code Collaboration
Podnet IRC Network
AmpHosted
Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%