Excel headers/footers won't change via VBA unless blank

后端 未结 4 586
情歌与酒
情歌与酒 2020-12-19 03:36

Disclaimer: It\'s been a few years since I worked (a lot) with VBA, so this might be an issue caused by confusing myself with what is essentially a very different language f

4条回答
  •  温柔的废话
    2020-12-19 04:10

    The line Application.PrintCommunication = False (which is added by the macro recorder) before doing PageSetup screws up the formating via VBA.

    If your code has got this line in it, try removing it. That solved my problem with setting the header and footer via VBA.

提交回复
热议问题