Excel Bug after Printpreview by vba? anyone exp this before?

radian89

Board Regular
Joined
Nov 12, 2015
Messages
113
Hi All,

I use excel 2016 in Windows 10

i managed to use some vba code here to do this routine :
1. Hide formula bar & Display heading
Code:
    ActiveWindow.DisplayHeadings = False
    Application.DisplayFormulaBar = False
2. Hide ribbons
Code:
CommandBars.ExecuteMso "HideRibbon"
3. Hide Sheet tabs
Code:
ActiveWindow.DisplayWorkbookTabs = False

this is to lock all the sheets i had & make it user interface bigger. then i have this code for print preview

Code:
Sub printpreview()

ActiveSheet.printpreview


End Sub

for each sheets, i put "print preview" button there. once i click print preview it goes normal then after i export it to pdf, it become messed up, all is messed up, even the pdf exported is messed up.

BEFORE i click print preview
34xi043.jpg



AFTER i click print preview
8x6g6d.jpg


THERE'S UNIQUE CONDITION HERE :
it only happened when i use all the 3 routines i mentioned above.
while if we do it without these 3 routines is all okay.

any suggestion/exp like this before guys? if yes, what should i do? how to overcome this? and why this is happen

thanks so much


- Adrian -
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
turn off the print preview before printing, layout issues do occur, especially were the font is off standard
 
Upvote 0
turn off the print preview before printing, layout issues do occur, especially were the font is off standard

well, thanks for the suggestion but print preview here for review it before printing, i guess this step can't be skipped. have any other ideas?
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top