I am using JACOB for excel interface automation and I am able to read a value from cell or write value to a cell but not able to move the cursor to the required cell. Any help in this regards is appreciated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using JACOB for excel interface automation and I am able to read a value from cell or write value to a cell but not able to move the cursor to the required cell. Any help in this regards is appreciated
It should work with Dispatch.call(+++your cell as Dispatch Objrvz+++,"Select")
ActiveXComponent excel = new ActiveXComponent("Excel.Application");
Dispatch workbooks = excel.getProperty("Workbooks").toDispatch();
Dispatch workBook = Dispatch.call(workbooks, "Open", file.getAbsolutePath()).toDispatch();
Dispatch sheets = Dispatch.get(workBook, "Worksheets").toDispatch();
Dispatch workSheet = Dispatch.call(sheets, "Item", 1).toDispatch();
Dispatch cell = Dispatch.call(workSheet, "Cells", 1).toDispatch();
Object takingValue = Dispatch.get(cell, "Value")
Dispatch.put(cell, "Value", "new value");