Menu

Move cursor to excel cell by cell address

Help
SaiTanmai
2014-03-25
2021-01-29
  • SaiTanmai

    SaiTanmai - 2014-03-25

    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

     
  • Keyzor

    Keyzor - 2014-04-10

    It should work with Dispatch.call(+++your cell as Dispatch Objrvz+++,"Select")

     
  • Alexandr Myagkov

    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");

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.