找不到数据成员的问题
我想实现这样的功能,把EXCEL里图片高度及边距与图片所在单元格统一。
Option Explicit
Private Sub Command1_Click()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Height = shp.TopLeftCell.Height
shp.Left = shp.TopLeftCell.Left
shp.Top = shp.TopLeftCell.Top
Next shp
End Sub
Private Sub Form_Load()
Dim XlApp As New Excel.Application '使用 Excel 对象删除指定行
Dim XlBook As New Excel.Workbook
Dim XlSheet As New Excel.Worksheet
Set XlApp = CreateObject("Excel.Application") '创建EXCEL对象
XlApp.Visible = True
XlApp.Caption = "应用程序调用 Microsoft Excel"
Set XlBook = XlApp.Workbooks.Open(App.Path & "\7-21 统一图片高度及边距.xlsm")
Set XlSheet = XlBook.Worksheets(1)
End Sub
以上是代码。
请问高手,应该如何解决呀?谢谢!