如何从Microsoft Excel获取滚动位置 [英] How do I get the scroll position from Microsoft Excel
本文介绍了如何从Microsoft Excel获取滚动位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在使用Microsoft Office Automation时,我想将图像插入电子表格中.如何确定当前用户的滚动位置?
When using Microsoft office automation I want to insert images into a spreadsheet. How can I determine the current users scroll location?
推荐答案
在Excel中,您可以使用Window对象的VisibleRange属性,即
In Excel you may use the VisibleRange property of the Window object, i.e.
Private Sub DirtyTest()
Dim MyW As Window, TopRow As Long, TopCol As Long
Set MyW = Windows(1) ' index 1 always refers to the window displayed
TopRow = MyW.VisibleRange.Cells.Row
TopCol = MyW.VisibleRange.Cells.Column
' any other code
End Sub
希望有帮助
祝你好运MikeD
这篇关于如何从Microsoft Excel获取滚动位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文