Excel精英培训网

 找回密码
 注册
查看: 1392|回复: 0

用chat.export方法不能另存图片office2003

[复制链接]
发表于 2016-4-17 20:41 | 显示全部楼层 |阅读模式
问题rt
运行环境:win2003s+office2003
下了帖子http://www.excelpx.com/thread-198048-1-1.html中的附件,保存图片时,没有任何错误提示,但是没有图片文件生成。

同样文件,在office2013环境下,可以正常生成图片文件。


另外,使用如下代码时,执行到 .Export ThisWorkbook.Path & "\" & i & ".jpg" ,会报错:“运行时错误 1004:应用程序定义或对象定义错误。”,运行环境同样式win2003s+office2003

Sub dd()
Dim shap As Shape
Dim i As Integer
    With ActiveSheet
        For i = 1 To .Shapes.Count
            Set shap = .Shapes(i)
            shap.CopyPicture Appearance:=xlScreen, Format:=xlPicture
        With .ChartObjects.Add(0, 0, shap.Width, shap.Height).Chart
            .Paste
            .Export ThisWorkbook.Path & "\" & i & ".jpg"
            .Parent.Delete
        End With
        Next
    End With
End Sub


excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-30 16:04 , Processed in 0.277160 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表