Get the Zoom Factor after 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!
 
J

Jérémie Gent

OK Thank you Dave!

I see I wasn't the only one to use this 'trick'
I don't really like the sendkeys method though, but it might be ok for this
time, as I'm working in a pretty homogen environnement (all users of this
project have Office 2000 SP3 in german).
Unless maybe you know another 'quite easy' way to calculate the zoom factor
manually ?

thanks again!
Jérémie
 
D

Dave Peterson

I've never seen any other way to get that zoom factor.

The good news is that newer versions of excel (xl2002 and xl2003, IIRC) will
respect your manual page breaks even if you use "fit to pages wide and pages
tall".

Maybe it's time for an upgrade???
 
J

Jérémie Gent

That's right Dave, an upgrade would be very welcome (and would solve many
other problems that I have to face), but it's not so easy as it concerns the
whole group ...
Thanks anyway!

Jérémie
 

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