问题循环通过工作簿中的工作表

我在课堂上有家庭作业的debugging问题,我做了我所看到的必要的改变,但我得到一个错误。 它说method or data member not found我的代码是shtCurrent.name在消息框中。

我已经尽可能地研究了,但是我找不到答案。 谁能帮我吗?

谢谢。

 Public Sub PrintWorksheets1() 'declare variables and assign address to object variable Dim strPrint As String, wkbHours As Workbook, shtCurrent As Worksheets Set wkbHours = Application.Workbooks("auco6215_HW10_Ex9.xlsm") wkbHours.Activate 'ask user if he or she wants to print the worksheet For Each shtCurrent In wkbHours.Worksheets strPrint = _ MsgBox(prompt:="Print " & shtCurrent.Name & "?", Buttons:=vbYesNo + vbExclamation) If strPrint = vbYes Then 'if user wants to print shtCurrent.PrintPreview End If Next shtCurrent End Sub 

shtCurrent As WorksheetsshtCurrent As Worksheets不应该是工作表S集合,只是工作表对象。

 Dim strPrint As String, wkbHours As Workbook, shtCurrent As Worksheet