Yeni excel dosyası kaydetme

tamer42

Destek Ekibi
Destek Ekibi
Katılım
11 Mart 2005
Mesajlar
3,110
Excel Vers. ve Dili
Office 2013 İngilizce
Merhaba,
Aşağıdaki kodla yeni bir excel dosyası oluştururken,

Eğer oluşturulacak dosya adı klasörün içinde mevcut ise; herhangi bir soru sormadan direkt üzerine yazması nasıl sağlanabilir?

iyi Çalışmalar.

Kod:
Dim objxl As Excel.Application
Dim yeniexcel As Excel.Workbook

MyPath = ThisWorkbook.Path & "\Rapor"

fName ="abc1234"
Set yeniexcel = Workbooks.Add

With yeniexcel

.SaveAs FileName:=MyPath & "\" & fName & ".xlsx"
.Close

End With
 

muygun

Özel Üye
Katılım
6 Temmuz 2004
Mesajlar
9,207
Excel Vers. ve Dili
Excel-2003 Türkçe
Merhaba;
kodun başlangıcına;

Application.DisplayAlerts = False’ pc sorgusunu pas geçme
ekleyerek deneyin.
sonuç alamazsanız;

Sub kaydet()
Application.ScreenUpdating = False
Set flk = CreateObject("Scripting.FileSystemObject")
klasor = ThisWorkbook.Path
fName = "abc1234"
MyPath = ThisWorkbook.Path & "\Rapor\"
Kayıt_Yeri = MyPath & fName & ".xls"
ActiveWorkbook.Save
flk.CopyFile ThisWorkbook.FullName, Kayıt_Yeri
End Sub

Kodları ile deneyin.
İyi çalışmalar.
 

tamer42

Destek Ekibi
Destek Ekibi
Katılım
11 Mart 2005
Mesajlar
3,110
Excel Vers. ve Dili
Office 2013 İngilizce
Merhaba;
kodun başlangıcına;

Application.DisplayAlerts = False’ pc sorgusunu pas geçme
ekleyerek deneyin.
sonuç alamazsanız;

Sub kaydet()
Application.ScreenUpdating = False
Set flk = CreateObject("Scripting.FileSystemObject")
klasor = ThisWorkbook.Path
fName = "abc1234"
MyPath = ThisWorkbook.Path & "\Rapor\"
Kayıt_Yeri = MyPath & fName & ".xls"
ActiveWorkbook.Save
flk.CopyFile ThisWorkbook.FullName, Kayıt_Yeri
End Sub

Kodları ile deneyin.
İyi çalışmalar.
teşekkürler Hocam
iyi akşamalar.
 
Üst