使用Microsoft Office Automation时,我希望将图像插入电子表格。如何确定当前用户的滚动位置?
在Excel中,您可以使用Window对象的VisibleRange属性,即
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
希望有所帮助
祝好运