将选择的图片放大两倍的问题
我要把在EXCEL工作簿里的选中的图片放大两倍。
代码如下:
Option Explicit
Dim XlApp As New Excel.application '使用 Excel 对象删除指定行
Dim XlBook As New Excel.Workbook
Dim XlSheet As New Excel.Worksheet
Dim selection As Excel.Shape
Private Sub Command1_Click()
On Error GoTo ErrLine
selection.shaperange.ScaleHeight 2, msoFalse, msoscalefromtopleft
If application.version < 12 Then
selection.shaperange.ScaleWidth 2, msoFalse, msoscalefromtopleft
End If
Exit Sub
ErrLine:
MsgBox "请选择图片后再执行本过程", vbInformation, "错误提示"
End Sub
Private Sub Form_Load()
Set XlApp = CreateObject("Excel.Application") '创建EXCEL对象
XlApp.Visible = True
XlApp.Caption = "应用程序调用 Microsoft Excel"
Set XlBook = XlApp.Workbooks.Open(App.Path & "\7-26 重新描述错信息.xlsm")
Set XlSheet = XlBook.Worksheets(1)
End Sub
我试了一下,在EXCEL里用VBA是可以的,在VB里不行,提示
msoFalse没定义,我应该怎么改呀?谢谢!