0
Bir sınıf için aşağıdaki kodu hata ayıklamaya çalışıyorum. Hayatım boyunca her bir açıklamada neyin yanlış olduğunu göremiyorum.Nesne, VBA'daki özellik veya yöntem hatasını desteklemiyor Her döngü için
Public Sub PrintWorksheets1()
'declare variables and assign address to object variable
Dim intPrint As Integer, wkbHours As Workbook, shtCurrent As Worksheets
Set wkbHours = Application.Workbooks("T9-EX-E9D.xls")
'ask user if he or she wants to print the worksheet
For Each shtCurrent In wkbHours
intPrint = _
MsgBox(prompt:="Print " & shtCurrent.Name & "?", Buttons:=vbYesNo + vbExclamation)
If intPrint = vbYes Then 'if user wants to print
shtCurrent.PrintPreview
End If
Next shtCurrent
End Sub
Etkin sayfaya ve yalnızca çalışma sayfalarına shtCurrent ayarlamayı denedim. Herhangi bir yardım büyük ölçüde takdir edilecektir!
teşekkür ederiz! Her bir açıklama için sadece çalışma kitabı seviyesinden ziyade çalışma sayfaları seviyesine inmek gerektiğini görüyorum. –