標題:
[發問]
輸出圖片檔,執行階段錯誤1004
[打印本頁]
作者:
t8899
時間:
2019-2-22 21:53
標題:
輸出圖片檔,執行階段錯誤1004
輸出圖片檔,執行階段錯誤1004 [attach]30133[/attach]
excel 2003
win7
[attach]30132[/attach]
作者:
Joforn
時間:
2019-2-23 11:12
#If VBA7 Then
Private Declare PtrSafe Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
#Else
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
#End If
Private Sub CommandButton4_Click()
Dim abc As Range
Dim f As Range
Dim rngCopy As Range
Set f = Range("a1")
Set abc = Range("o2:o1000").Find(What:="*", LookIn:=xlValues, SearchDirection:=xlPrevious, LookAt:=xlWhole)
Set rngCopy = Range(f, abc.Offset(1, 2))
rngCopy.CopyPicture Format:=xlBitmap
With Sheet2.ChartObjects.Add(0, 0, rngCopy.Width, rngCopy.Height).Chart
DoEvents
WaitTimes 200
.Paste
' .Export Filename:="r:\temp\ABC.JPG", FilterName:="JPG"
.Export Filename:="c:\1.JPG", FilterName:="JPG"
.Parent.Delete
End With
End Sub
Private Sub WaitTimes(ByVal lngTime As Long)
Do While lngTime > 0
DoEvents
Sleep 20
lngTime = lngTime - 20
Loop
End Sub
複製代碼
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)