WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: JohnR on February 26, 2019, 08:18:15 PM

Title: Excel OLE active cell coordinates
Post by: JohnR 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
Title: Re: Excel OLE active cell coordinates
Post by: stanl 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 .
Title: Re: Excel OLE active cell coordinates
Post by: JohnR on February 27, 2019, 04:30:31 AM
Thanks, oXL.Activecell.Address solved my problem
Title: Re: Excel OLE active cell coordinates
Post by: td 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 (https://docs.microsoft.com/en-us/office/vba/api/overview/excel)