New to NetOffice need to find value and update column

Oct 14, 2016 at 1:37 AM
I need to develop a quick application to interact with excel. I have a brief look at the examples but could not see how to.
  1. select a spreadsheet page (tab)
  2. Find a value in a column on a page.
Would love some direction on where to find an example or what I use to do the above tasks.

Outline of the task I have to do.

Open an existing spreadsheet.
Find a value in a column on a page (tab)
Update/add a value to a column in the same row.
When completed save sheet.

Many thanks for any replys.
Oct 14, 2016 at 3:53 PM
Just do it. (i'm sorry to all the lawyers from Nike here)

Workbooks.Open - to open the excel file
Workbooks.Sheets[x] - to select your target sheet
Rangle.Find - to find the target cell of your value
Range/Cell Value - to set your value
Workbook.Save - to save the changes

Done in a minute! i can give you a code snippet if you need it anyway.

Oct 17, 2016 at 3:32 AM
Edited Oct 17, 2016 at 11:12 AM
Hi Sebastian

Thanks for that it all works.

Two further question.

Is there a way to stop a macro/s from running when the excel file is opened or click a button of the first form that is displayed.
Easiest way to append a row to a sheet.

All other works well and great product.

Best Regards
Oct 18, 2016 at 8:36 PM
I found a way to get the last empty row

int newRow = workSheet.UsedRange.Rows.Count + workSheet.UsedRange.Row;

now to disable the macro built into the spreadsheet to prevent it running on opening of the spreadsheet

Best Regards