excel vba not exporting pagesetup to pdf correctly

后端 未结 3 1964
-上瘾入骨i
-上瘾入骨i 2020-12-11 05:41

I have code which formats a worksheet to the desired setup and layout (one page wide and tall in landscape). When I run the code (part of a long macro) it formats the pagese

3条回答
  •  渐次进展
    2020-12-11 06:06

    Yes!!!, I have had the same problem: I was not able to export a sheet with the page Setup settings already applied on it.

    Before trying the Application.PrintCommunication I tested Wait and Sleep commands without success. Finally I skipped this issue by using CopyPicture method, adding a chart page and then exporting it to pdf, but resolution in my pdf it was not fine and I was not able to play with margins.

    So just add Application.PrintCommunication=false before your code , on pagesetup settings like CaptainABC says and most important: close with Application.PrintCommunication=true after the code.

    Thank you for this useful post.

提交回复
热议问题