J
Joseph Geretz
Originally, I was using the following statement to copy an image of a
worksheet, so that the worksheet information can be displayed as read-only
to the user:
SourceWorksheet.UsedRange.CopyPicture
(The reason we use this esoteric approach is because we're not in control of
the source document. We don't know what protection may already be applied.
We don't know what information or widgets are contained within the
worksheet. We're just given a worksheet of unknown origin and we need to
display it as read-only to the user.)
We found however, that this doesn't result in a faithful image of the
underlying worksheet: The following is much more effective:
SourceWorksheet.UsedRange.CopyPicture XlPictureAppearance.xlScreen,
XlCopyPictureFormat.xlBitmap
However, the xlBitmap format must be much more intensive than the xlPicture
format. I'm finding that with huge worksheets (i.e the worksheet developer
has placed information, somethimes just background coloring, down to a
ridiculous right/bottom corner) this take a looooong tim to accomplish.
However, in all of these cases, the user has set a more reasonable print
area. So here's what I'd like to do.
1. Figure our what range is actually represented by UsedRange
2. If this exceeds a defined threshold, figure out the range represented by
PrintArea.
3. If this still exceeds the defined threshold, then I'll just use the free
Excel Viewer to display the document.
If you can tell me how to convert these two 'logical' ranges, UsedRange and
PrintArea to defined cell coordinates, I'll be able to give this a shot.
Thanks for your help!
- Joseph Geretz -
worksheet, so that the worksheet information can be displayed as read-only
to the user:
SourceWorksheet.UsedRange.CopyPicture
(The reason we use this esoteric approach is because we're not in control of
the source document. We don't know what protection may already be applied.
We don't know what information or widgets are contained within the
worksheet. We're just given a worksheet of unknown origin and we need to
display it as read-only to the user.)
We found however, that this doesn't result in a faithful image of the
underlying worksheet: The following is much more effective:
SourceWorksheet.UsedRange.CopyPicture XlPictureAppearance.xlScreen,
XlCopyPictureFormat.xlBitmap
However, the xlBitmap format must be much more intensive than the xlPicture
format. I'm finding that with huge worksheets (i.e the worksheet developer
has placed information, somethimes just background coloring, down to a
ridiculous right/bottom corner) this take a looooong tim to accomplish.
However, in all of these cases, the user has set a more reasonable print
area. So here's what I'd like to do.
1. Figure our what range is actually represented by UsedRange
2. If this exceeds a defined threshold, figure out the range represented by
PrintArea.
3. If this still exceeds the defined threshold, then I'll just use the free
Excel Viewer to display the document.
If you can tell me how to convert these two 'logical' ranges, UsedRange and
PrintArea to defined cell coordinates, I'll be able to give this a shot.
Thanks for your help!
- Joseph Geretz -