Author Topic: Excel OLE active cell coordinates  (Read 157 times)

JohnR

  • Newbie
  • *
  • Posts: 2
Excel OLE active cell coordinates
« on: February 26, 2019, 08:18:15 pm »
Hello,
I am trying to determine what the active cell coordinates are in an Excel worksheet, that has been opened by the OLE/COM, and the user has moved the active cell.
Any help would be much appreciated.
Thanks
John

stanl

  • Pundit
  • *****
  • Posts: 889
Re: Excel OLE active cell coordinates
« Reply #1 on: February 27, 2019, 03:24:21 am »
Assuming your Excel Object is something like oXL, then oXL.Activecell.Address - but your post implies the user is in charge not the script, in which case I would suggest writing worksheet code for an Excel event such as OnChange (which doesn't really apply here), or have your script using a callback with a timer to report the active cell, which sounds like a waste.


Maybe provide more detail .

JohnR

  • Newbie
  • *
  • Posts: 2
Re: Excel OLE active cell coordinates
« Reply #2 on: February 27, 2019, 04:30:31 am »
Thanks, oXL.Activecell.Address solved my problem

td

  • Tech Support
  • *****
  • Posts: 2849
    • WinBatch
Re: Excel OLE active cell coordinates
« Reply #3 on: February 27, 2019, 07:46:23 am »
MSFT's documentation for Excel COM Automation objects can be found here:

https://docs.microsoft.com/en-us/office/vba/api/overview/excel
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade