Cell Coordinates and Printing

R

Robin Cole

I'm using ExportAsFixedFormat to create an XPS file of a worksheet. I'd like
to iterate through cells in the sheet and determine the coordinates of each
cell as it was printed on the XPS page. I've run into two problems with this.

1. The Left property of Range objects return different values depending on
the current view mode ("Normal", "Page Layout", and "Page Break Preview"). In
"Page Layout" mode, it lines up perfectly but the other two modes are equally
shifted left.

2. Values of the Top property are slightly too large (even in "Page Layout"
mode). For example, with 3/4 inch margins, a typical page is 9.5 inches or
684 points high. The Top of the bottom row printed on this page is returned
as 690.

What can I do to get around these problems and accurately determine page
coordinates?
 

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