none
Excel 外接程序中,如何获取当前选中的图片对象? RRS feed

  • 问题

  •  Public Sub Test(ByVal control As Office.IRibbonControl)
            Dim Epp As Excel.Application
            Epp = Globals.ThisAddIn.Application
            Dim rg As Excel.Range, a As Excel.Shape, k1 As Int16, k2 As Int16
            'On Error Resume Next
            a = Epp.Selection
    '为什么运行到这里A的值是nothing?
    a.Left = a.TopLeftCell.Offset(1, 0).Left + (a.TopLeftCell.Offset(1, 0).Width - a.Width) / 2
            a.Top = a.TopLeftCell.Offset(1, 0).Top + (a.TopLeftCell.Offset(1, 0).Height - a.Height) / 2
        End Sub

    2014年7月25日 8:12

答案