Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making an Interoperability application with excel in C #. The aim is to put information in the textboxes and load this information to an excel sheet. I can fill the first column in the excel sheet... but what i want is to press a button that i have named "clean" and automatically clean the contents of the textboxes and then the new information that will be entered goes to the next Excel sheet column and so on.

Here is an example of the code I have:

C#
private void button9_Click(object sender, EventArgs e)
        {
            var excelApplication = new MyExcel.Application();
            excelApplication.Visible = false;
            MyExcel.Workbook excelWorkBook = excelApplication.Workbooks.Open(textBox189.Text);
            MyExcel.Worksheet excelWorkSheet = excelWorkBook.ActiveSheet;



            excelWorkSheet.Cells[25, 2] = textBox6.Text;
            excelWorkSheet.Cells[27, 2] = textBox11.Text;
            excelWorkSheet.Cells[29, 2] = textBox10.Text;
            excelWorkSheet.Cells[31, 2] = textBox9.Text;
            excelWorkSheet.Cells[35, 2] = textBox8.Text;
            excelWorkSheet.Cells[39, 2] = textBox7.Text;




            excelWorkBook.Save();
        }


Someone help me?

Thanks.
Posted
Comments
Abhipal Singh 26-Jun-15 1:01am    
What is the issue with the above code snippet?
Are you getting any error?
Where are you stuck?

1 solution

What to fill columns??

Fill Color???? What is your issue. ??
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900