ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Coordinates and Printing (https://www.excelbanter.com/excel-programming/409431-cell-coordinates-printing.html)

Robin Cole

Cell Coordinates and Printing
 
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?


All times are GMT +1. The time now is 12:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com