jpg olarak kaydet (office 2019)

sevensuleyman

Altın Üye
Katılım
9 Kasım 2012
Mesajlar
178
Excel Vers. ve Dili
office 2010
Altın Üyelik Bitiş Tarihi
08-12-2027
merhaba ; excellde resim olarak kaydettiğim excell dosyanı office 2019 da kullanamıyorum. resimler beyaz boş olarak akydetmektedir. kod nasıl düzeltebilriz.

Kod:
Private Sub CommandButton2_Click()
Dim objTemp As Object
Dim chtMyChart As Chart

Range("B8").Copy

Set objTemp = ActiveSheet.Shapes.AddShape(1, 1, 1, 1, 1)
objTemp.Select
ActiveSheet.Paste
objTemp.Delete

klasor = ThisWorkbook.Path
say = CreateObject("Scripting.FileSystemObject").GetFolder(klasor).Files.Count + 1
Dosya = klasor & "\Kampanya " & Range("B3") & Format(Now, "( dd.mm.yyyy_hh.mm )") & ".png"


With Selection
.CopyPicture 1, 2
Set chtMyChart = ActiveSheet.ChartObjects.Add(1, 1, .Width, .Height).Chart
With chtMyChart
.Paste
.Export Dosya
.Parent.Delete
End With
.Delete
End With
MsgBox Dosya & Chr(10) & " olarak kaydedildi.", , "UYARI"

Set objTemp = Nothing
End Sub
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,767
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
Bunu bir denermisiniz.

Kod:
Private Sub CommandButton2_Click()
Dim objTemp As Object
Dim chtMyChart As Chart

Range("B8").Copy

Set objTemp = ActiveSheet.Shapes.AddShape(1, 1, 1, 1, 1)
objTemp.Select
ActiveSheet.Paste
objTemp.Delete

klasor = ThisWorkbook.Path
say = CreateObject("Scripting.FileSystemObject").GetFolder(klasor).Files.Count + 1
Dosya = klasor & "\Kampanya " & Range("B3") & Format(Now, "( dd.mm.yyyy_hh.mm )") & ".png"


With Selection
If Val(Application.Version) > 11 Then
.Copy
Else
.CopyPicture 1, 2
End If


Set chtMyChart = ActiveSheet.ChartObjects.Add(1, 1, .Width, .Height).Chart
With chtMyChart
.Paste
.Export Dosya
.Parent.Delete
End With
.Delete
End With
MsgBox Dosya & Chr(10) & " olarak kaydedildi.", , "UYARI"

Set objTemp = Nothing
End Sub
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
41,591
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Alternatif olarak inceleyiniz..

 

sevensuleyman

Altın Üye
Katılım
9 Kasım 2012
Mesajlar
178
Excel Vers. ve Dili
office 2010
Altın Üyelik Bitiş Tarihi
08-12-2027
Bunu bir denermisiniz.

Kod:
Private Sub CommandButton2_Click()
Dim objTemp As Object
Dim chtMyChart As Chart

Range("B8").Copy

Set objTemp = ActiveSheet.Shapes.AddShape(1, 1, 1, 1, 1)
objTemp.Select
ActiveSheet.Paste
objTemp.Delete

klasor = ThisWorkbook.Path
say = CreateObject("Scripting.FileSystemObject").GetFolder(klasor).Files.Count + 1
Dosya = klasor & "\Kampanya " & Range("B3") & Format(Now, "( dd.mm.yyyy_hh.mm )") & ".png"


With Selection
If Val(Application.Version) > 11 Then
.Copy
Else
.CopyPicture 1, 2
End If


Set chtMyChart = ActiveSheet.ChartObjects.Add(1, 1, .Width, .Height).Chart
With chtMyChart
.Paste
.Export Dosya
.Parent.Delete
End With
.Delete
End With
MsgBox Dosya & Chr(10) & " olarak kaydedildi.", , "UYARI"

Set objTemp = Nothing
End Sub
maalesef aynı sorun devam ediyor.
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,767
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
.Copy

yukarıdaki bölümü bul aşağıdaki ile değiştir.

.CopyPicture
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
41,591
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Vermiş olduğum linki incelediniz mi?
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,767
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
kod
Kod:
Private Sub CommandButton2_Click()
Dim Alan As Range
Dim Dosya As String

klasor = ThisWorkbook.Path
say = CreateObject("Scripting.FileSystemObject").GetFolder(klasor).Files.Count + 1
Dosya = klasor & "\Kampanya " & Range("B3") & Format(Now, "( dd_mm_yyyy_hh_nn_ss )") & ".jpg"

Set Alan = ActiveSheet.Range("B8")

Alan.CopyPicture Appearance:=xlScreen, Format:=xlPicture
With ActiveSheet.ChartObjects.Add(Left:=Alan.Left, Top:=Alan.Top, Width:=Alan.Width, Height:=Alan.Height)
.Name = "TempChart"
.Activate
End With

ActiveChart.Paste
With ActiveSheet.ChartObjects("TempChart")
.Chart.Export (Dosya)
.Delete
End With

Set Alan = Nothing
End Sub
 

sevensuleyman

Altın Üye
Katılım
9 Kasım 2012
Mesajlar
178
Excel Vers. ve Dili
office 2010
Altın Üyelik Bitiş Tarihi
08-12-2027
kod
Kod:
Private Sub CommandButton2_Click()
Dim Alan As Range
Dim Dosya As String

klasor = ThisWorkbook.Path
say = CreateObject("Scripting.FileSystemObject").GetFolder(klasor).Files.Count + 1
Dosya = klasor & "\Kampanya " & Range("B3") & Format(Now, "( dd_mm_yyyy_hh_nn_ss )") & ".jpg"

Set Alan = ActiveSheet.Range("B8")

Alan.CopyPicture Appearance:=xlScreen, Format:=xlPicture
With ActiveSheet.ChartObjects.Add(Left:=Alan.Left, Top:=Alan.Top, Width:=Alan.Width, Height:=Alan.Height)
.Name = "TempChart"
.Activate
End With

ActiveChart.Paste
With ActiveSheet.ChartObjects("TempChart")
.Chart.Export (Dosya)
.Delete
End With

Set Alan = Nothing
End Sub
teşekkürler sorunsuz çalıştı. kolay gelsin
 
Üst