Sub ShowPageCount() For Each sht In Worksheets sht.Activate Pages = ExecuteExcel4Macro("Get.Document(50)") Debug.Print Pages Next shtEnd Sub