Hi, all:
I have a procedure that asks for the name and type of a worksheet when I run through the sheets object and I get err 438 "Object Doesn't support this property..."
If I use Worksheets, it's fine for type, but does not count a chart, DLG or Macro. If I use the sh object, it counts them all but errs on the type for charts,DLG or Macro. (I was trying ActiveSheet @ the end to see if that made a difference.
I'm trying to find the Type because other code will do something w/the sheet dependent on type.
thanks,
Ron Repp
If gray hair is a sign of wisdom, then I'm a genius.
My newest novel: Wooden Warriors
I have a procedure that asks for the name and type of a worksheet when I run through the sheets object and I get err 438 "Object Doesn't support this property..."
Code:
Sub countsheets()
'For i = 1 To Sheets.Count
' MsgBox Sheets(i).Name '& vbCrLf & Worksheets(i).Name & vbCrLf & Worksheets(i).Type
'Next
For Each sh In ActiveWorkbook.Sheets
sh.Activate
MsgBox ActiveSheet.Name & vbCrLf & ActiveSheet.Type
Next
End Sub
If I use Worksheets, it's fine for type, but does not count a chart, DLG or Macro. If I use the sh object, it counts them all but errs on the type for charts,DLG or Macro. (I was trying ActiveSheet @ the end to see if that made a difference.
I'm trying to find the Type because other code will do something w/the sheet dependent on type.
thanks,
Ron Repp
If gray hair is a sign of wisdom, then I'm a genius.
My newest novel: Wooden Warriors