FitToPagesWide

J

Jérémie Gent

Hi! I'vo got an Excel sheet that I'd like to print 'properly' from vba code.
It must be 1 A4 wide (portrait) and contains many manual PageBreaks.
Here is my idea: I first set the PageSetup that way
PageSetup.zoom=false
PageSetup.FitToPagesWide=1
PageSetup.FitToPagesWide=50
(for example), so a zoom factor is calculated for the width to be correct
and the sheet fits to 1 page wide.
Unfortunately, I can't print that way, because in this mode, the manual
PageBreaks are ignored, so I have to set it back to zoom mode, so I'd like
to switch back to
PageSetup.zoom = x
where x would be the previously calculated zoom factor (in the FitToPage
mode), for example 70%

My problem is that I don't know where to read the value of the calculated
zoom factor (x)
Could someone help me ? (PageSetup.zoom stays to false, not to 70)
Maybe I could also calculate it myself ?

Thanks a lot!
 
D

Dave Peterson

You have a response in .excel.

Jérémie Gent said:
Hi! I'vo got an Excel sheet that I'd like to print 'properly' from vba code.
It must be 1 A4 wide (portrait) and contains many manual PageBreaks.
Here is my idea: I first set the PageSetup that way
PageSetup.zoom=false
PageSetup.FitToPagesWide=1
PageSetup.FitToPagesWide=50
(for example), so a zoom factor is calculated for the width to be correct
and the sheet fits to 1 page wide.
Unfortunately, I can't print that way, because in this mode, the manual
PageBreaks are ignored, so I have to set it back to zoom mode, so I'd like
to switch back to
PageSetup.zoom = x
where x would be the previously calculated zoom factor (in the FitToPage
mode), for example 70%

My problem is that I don't know where to read the value of the calculated
zoom factor (x)
Could someone help me ? (PageSetup.zoom stays to false, not to 70)
Maybe I could also calculate it myself ?

Thanks a lot!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top