使用macros在Excel中编辑页面的页脚

使用Excel(Office 2010),我使用相同的页脚和横向打印。 我做了一个macros将工作簿从纵向更改为横向,但是Excel / VB似乎不喜欢用macros编辑页面的页脚。

你能够用macros编辑页脚,使用可能的VB代码解决方法,否则?

你尝试录制macros吗? 我清理了这个,但这是直接从Excel 2003

Sub setFooter() On Error GoTo HandleErrors '@JimmyPena pointed out an msdn example that seems useful to incorporate Application.PrintCommunication = False With ActiveSheet.PageSetup .Orientation = xlLandscape .LeftFooter = "What" .CenterFooter = "a" .RightFooter = "Header" End With Application.PrintCommunication = True ExitHere: Exit Sub HandleErrors: ' If an error occurs, make sure you reset ' print communications. Application.PrintCommunication = True Resume ExitHere End Sub 

除非你有其他我不了解的问题