Merhaba arkadaşlar. Excelde bir sayfayı jpg olarak masaüstüne kaydetmek istiyorum. Makro kodum bundan 2 sene önce sorunsuz çalışıyordu tekrar kullanmam gerekti ancak şuan masaüstüne kaydediyor fakat boş bir resim olarak kaydediyor nerede hata olduğunu bulamadım. Excel 2016 kullanıyorum Windows 10 kurulu
Örnek dosya
www.dosya.tc
Makro kodları
Örnek dosya
ornek.xlsm dosyasını indir - download
ornek.xlsm dosyasını indir, download. Dosya.tc .Dosya Upload. Dosya Paylaş. Dosya Yükle

Makro kodları
Kod:
Sub foto()
Dim obce As Object
Dim caart As Chart
Dim jipeg As Range
masaustu = CreateObject("WScript.Shell").specialfolders("Desktop")
ad = "test"
For x = 1 To 20000
If Dir(masaustu & "\" & "ad" & x & ".jpg") = "" Then
yol = masaustu & "\" & "ad" & x & ".jpg"
Exit For
End If
Next
Application.ScreenUpdating = False
Set jipeg = ActiveSheet.Range("A1:U23")
jipeg.Copy
Set obce = ActiveSheet.Shapes.AddShape(1, 1, 1, 1, 1)
obce.Select
ActiveSheet.Paste
obce.Delete
With Selection
.CopyPicture 1, 2
Set caart = ActiveSheet.ChartObjects.Add(1, 1, .Width, .Height).Chart
Range("a1").Select
With caart
.Paste
.Export yol 'nereye çıkartılacaksa
.Parent.Delete
End With
.Delete
End With
Set jipeg = Nothing
Set obce = Nothing
End Sub