How do I get the scroll position from Microsoft Excel

北城以北 提交于 2019-12-08 10:45:22

问题


When using Microsoft office automation I want to insert images into a spreadsheet. How can I determine the current users scroll location?


回答1:


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

Hope that helps

Good luck MikeD



来源:https://stackoverflow.com/questions/1700203/how-do-i-get-the-scroll-position-from-microsoft-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!