VBA/Excel/Access/Word/Excel/ExecuteExcel4Macro
Версия от 16:33, 26 мая 2010; (обсуждение)
Application.ExecuteExcel4Macro
Sub Macro1_Version4()
Dim St As String
St = "PAGE.SETUP(, , " & _
"1.5, 1.5, 1.5, 1.5" & _
", 0, False, False, False, 1, 1, True, 1, 1,False, , " & _
"1, 1" & _
", False)"
Application.ExecuteExcel4Macro St
End Sub
Determining the number of printed pages
Sub ShowPageCount()
For Each sht In Worksheets
sht.Activate
Pages = ExecuteExcel4Macro("Get.Document(50)")
Debug.Print Pages
Next sht
End Sub