|
本人经常需要把资料发给客户,但是不希望被改动,所以要转换为图片形式,每天都要重复做这件事情,很烦,于是想用宏,但是总出问题,还请大家参谋:
Sub 转换为图片()
'
' 转换为图片 Macro
' ActiveWindow.SmallScroll Down:=9
ActiveCell.Offset(-16, -7).Range("A1:G29").Select
ActiveCell.Offset(12, -1).Range("A1").Activate
Selection.CopyPicture Appearance:=xlPrinter, Format:=xlPicture
Workbooks.Add
ActiveSheet.Paste
ActiveWindow.DisplayGridlines = False
ActiveWindow.SmallScroll Down:=9
Windows("2008-7-28.xls").Activate
Windows("Book2").Activate
ActiveWindow.SmallScroll Down:=-24
ChDir "D:\上传文件夹"
ActiveWorkbook.SaveAs Filename:="D:\上传文件夹\2008-7-28.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
执行时显示:运行时错误‘1004’,应用程序定义或对象定义错误 |
|