Select Cell Range in Excel ActiveX
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm hoping someone can help with a GUI i'm building that interacts with an Excel ActiveX object. I'm trying to get my GUI to report the RANGE which has been selected my the mouse, rather than the active cell which forms only one corner of the range.
has been some help, however the function:
ActRange = get(Spreadsheet1,'Range');
Does not appear supported, or if it is, I can't figure out how to extract the value e.g. 'a1:b5'
Does anyone know a work around?
Thanks in advance,
Glenn
0 个评论
采纳的回答
Friedrich
2012-2-29
Hi,
as far as I know there is no function for that in EXCEL. You have to get it yourself with the Adress property of the Cell object:
selected_range = [strrep(ex.Selection.Cells.Item(1).Address,'$',''),':',strrep(ex.Selection.Cells.Item(ex.Selection.Cells.Count).Address,'$','')]
Here ex is the handle to the EXCEL automation server.
5 个评论
Image Analyst
2013-6-23
How do you propose to let the computer know that you have selected the final range? I mean, you could click on various cells, and even highlight some rectangles, before you decide to "go with" the current selection. How do you tell it you're ready to leave Excel and continue with your MATLAB code?
Jean OMB
2021-7-9
Hi, im learning on how to work with Activex and I was wonedering if any of you guys were able to open an excel file from matlab and select a range of cells with the mouse? if you did, can you show the code?Thanks!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ActiveX 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!