Yazıcı Seçiminde İptal Seçeneği

Katılım
3 Ağustos 2006
Mesajlar
38
Excel Vers. ve Dili
MS Office 2007 Enterp.
Aşağıdaki kodlar ile user form üzerindeki CheckBox lardan seçtiğim sayfaları yazıcıya gönderiyorum

Ekrana gelen yazıcı seçme menüsünden herhangi bir nedenle İPTAL butonuna bassam dahi defaulth olarak seçili olan yazıcıya seçili sayfayı gönderiyor yani İPTAL komutu bir işe yaramıyor
İPTAL tuşuna bastığımda userform a geri dönmesini nasıl sağlarım


Private Sub CommandButton16_Click()

If CheckBox1 = True Then GoTo 150 Else
If CheckBox2 = True Then GoTo 150 Else
If CheckBox3 = True Then GoTo 150 Else
If CheckBox4 = True Then GoTo 150 Else
If CheckBox5 = True Then GoTo 150 Else
If CheckBox6 = True Then GoTo 150 Else
If CheckBox7 = True Then GoTo 150 Else
If CheckBox8 = True Then GoTo 150 Else
If CheckBox9 = True Then GoTo 150 Else

MsgBox " Yazdırılacak Sayfa Seçilmedi "
Exit Sub
150

Application.Dialogs(xlDialogPrinterSetup).Show

If CheckBox1 = True Then
Sheets("1").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox1 = False
If CheckBox2 = True Then
Sheets("3").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox2 = False
If CheckBox3 = True Then
Sheets("3").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox3 = False
If CheckBox4 = True Then
Sheets("4").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox4 = False
If CheckBox5 = True Then
Sheets("5").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox5 = False
If CheckBox6 = True Then
Sheets("6").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox6 = False
If CheckBox7 = True Then
Sheets("7").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox7 = False
If CheckBox8 = True Then
Sheets("8").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
Application.Wait Now + TimeValue("00:00:05") / 1.5
End If
CheckBox8 = False
If CheckBox9 = True Then
Sheets("all").Select
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate _
:=True
End If
CheckBox9 = False
MsgBox " Seçili Sayfalar Yazıcıya Gönderildi "
End Sub


ilgilenenlere teşekkürler
 
Son düzenleme:
Katılım
3 Ağustos 2006
Mesajlar
38
Excel Vers. ve Dili
MS Office 2007 Enterp.
Başka Türlü Sorayım

Application.Dialogs(xlDialogPrinterSetup).Show

Komutu ile ekrana gelen printer seçme ekranından TAMAM yerine İPTAL e basıp
( Örneğin kullanmak istediğimiz printer tanımlı değil) çıkmak istediğimde yinede makronun devamında yazdırılacak olan sayfa DEFAULTH olarak tanımlı printer da yazdırılıyor. Bunu nasıl önleyebilirim teşekkür ederim
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,058
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Aşağıdaki gibi deneyin.

Kod:
sor = Application.Dialogs(xlDialogPrinterSetup).Show
If sor = False Then Exit Sub
 
Katılım
3 Ağustos 2006
Mesajlar
38
Excel Vers. ve Dili
MS Office 2007 Enterp.
Teşekkür

Sn LEVENTM önerdiğiniz uygulama problemimi çözdü
İlginize teşekkürler
 

aliakgul

Altın Üye
Katılım
9 Mayıs 2005
Mesajlar
402
Excel Vers. ve Dili
Ofis 2016 TR 64 Bit
Altın Üyelik Bitiş Tarihi
03-08-2025
Merhaba arkadaşlar,
Konu kirliliği oluşmasın diye burada sormak istiyorum:
Exe modunda çalışıyorum, yani sadece form görüntülenmekte ve çalışma sayfasının visible olayı false.
Application.Dialogs(xlDialogPrinterSetup).Show uygulamasında yazıcıyı seçince arka planda çalışma kitabı görüntülenmekte. Bunu nasıl önleyebilirim???
Teşekkür ederim.
 
Üst