mahdi0000
mahdi0000

Reputation: 7

c# excel interop Click on button

i want click on button in excel File with "Microsoft.Office.Interop.Excel". with following code just do select cell but Not clicked

        Microsoft.Office.Interop.Excel.Application ExcelApp = (Microsoft.Office.Interop.Excel.Application)Marshal.GetActiveObject("Excel.Application");
        Microsoft.Office.Interop.Excel.Workbook book = ExcelApp.ActiveWorkbook;
        Microsoft.Office.Interop.Excel.Worksheet sheet = book.ActiveSheet;
        Microsoft.Office.Interop.Excel.Range ExcelRange = sheet.get_Range("A4");
        ExcelRange.Select();

How to click button?

Upvotes: 0

Views: 1680

Answers (1)

Jacky Tan
Jacky Tan

Reputation: 31

Since I don't have enough reputation to comment yet, I will need to get clarification from you through the answer. Are you attempting to run a macro with the button click?

If so, the direction should be accessing the data itself or the macro itself.

For accessing Excel Data, you can refer to:

Read Data from Excel using C#

For accessing Excel Macro, you can refer to:

Running Excel Macro using C#

Upvotes: 1

Related Questions