• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Masaüstüne JPG olarak kayıt etme

  • Konbuyu başlatan Konbuyu başlatan aras90
  • Başlangıç tarihi Başlangıç tarihi
Katılım
2 Şubat 2022
Mesajlar
37
Excel Vers. ve Dili
Microsoft Excel 2013
İyi Bayramlar, Excel sayfamı masaüstüne kayıt etmek istiyorum. Aşağıda bulunan kod çalışıyor yalnız beyaz bir sayfa olarak kayıt ediyor sebebi nedir?

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
 
Merhaba,

İyi bayramlar. Deneyiniz.
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 2000
    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
jipeg.Select
Selection.CopyPicture
'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
    .ChartArea.Select
    .Paste
    .Export Yol 'nereye çıkartılacaksa
    .Parent.Delete
End With
'.Delete
End With
Set jipeg = Nothing
Set obce = Nothing
End Sub
 
Merhaba,

İyi bayramlar. Deneyiniz.
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 2000
    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
jipeg.Select
Selection.CopyPicture
'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
    .ChartArea.Select
    .Paste
    .Export Yol 'nereye çıkartılacaksa
    .Parent.Delete
End With
'.Delete
End With
Set jipeg = Nothing
Set obce = Nothing
End Sub

Teşekkür ederim Ömer bey :)
 
Geri
Üst