开发者

How do I get the scroll position from Microsoft Excel

开发者 https://www.devze.com 2022-12-11 02:07 出处:网络
When using Microsoft office automation I 开发者_Python百科want to insert images into a spreadsheet.How can I determine the current users scroll location?In Excel you may use the VisibleRange property

When using Microsoft office automation I 开发者_Python百科want to insert images into a spreadsheet. How can I determine the current users scroll location?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消