View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken McLennan[_5_] Ken McLennan[_5_] is offline
external usenet poster
 
Posts: 5
Default [SOLVED] Puzzling printarea code

G'day there Don,

On Tue, 28 Dec 2010 05:52:41 -0800, Don Guillett Excel MVP wrote:

Why not just copy the workbook and delete what is not needed and
convert to values
OR
copy the 2 sheets to the new wb and do the deed.


Hmmm... it's probably because I didn't think of it :)

Actually I did sort of consider it but rejected the idea for some
reason now forgotten. I think it was because I had it in the back of my
mind that this would be somewhat expensive on resources. Thinking about
it now, it's obvious that it wouldn't be extravagant and could well be
successful. It's certainly simpler that what I have written so I'll
work on that this afternoon. I'm in no state to try now as I've just
finished a night shift :)

Thanks for your suggestion Don. This should be much easier.

I'm still curious as to why it didn't work, but I found a thread at

http://www.xtremevbtalk.com/showthread.php?t=199706

which had this snippet:

If ActiveSheet.VPageBreaks.Count 0 Then
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight,
RegionIndex:=1
ActiveWindow.View = xlNormalView
End If

I adapted the code and it all worked well, but I'll still go with
your idea Don. The inherent simplicity implies that there will be a lot
less to go wrong.

See ya, and thanks again,
Ken McLennan
Qld, Australia