Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Start and Open in Page Break PreView

I have an attorney who wants all spreadsheets opened in PageBreak Preview.
Does anyone have an Auto_Open macro that not only opens all spreadsheets
this way, but creates a new workbook when Excel is opened and shows the view
as well as any new workbooks created?

Thanks much
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Start and Open in Page Break PreView

Using the pagebreak view of a newly created workbook doesn't make a lot of sense
to me.

Try it to see what it does. I wouldn't use it.

But this will do what you ask (both opening existing workbooks and creating new
workbooks).

Start a new workbook
copy this code into the ThisWorkbook module.

Option Explicit
Public WithEvents xlApp As Excel.Application
Private Sub Workbook_Open()
Set xlApp = Application
End Sub
Private Sub Workbook_Close()
Set xlApp = Nothing
End Sub
Private Sub xlApp_NewWorkbook(ByVal Wb As Workbook)
Dim myWindow As Window
For Each myWindow In Wb.Windows
myWindow.View = xlPageBreakPreview
Next myWindow
End Sub
Private Sub xlApp_WorkbookOpen(ByVal Wb As Workbook)
Dim myWindow As Window
For Each myWindow In Wb.Windows
myWindow.View = xlPageBreakPreview
Next myWindow
End Sub

Now save this workbook in your XLStart folder.

Then close excel and restart excel.

If you don't want the new workbook to be affected, just delete this portion:

Private Sub xlApp_NewWorkbook(ByVal Wb As Workbook)
Dim myWindow As Window
For Each myWindow In Wb.Windows
myWindow.View = xlPageBreakPreview
Next myWindow
End Sub

Sue Hughes wrote:

I have an attorney who wants all spreadsheets opened in PageBreak Preview.
Does anyone have an Auto_Open macro that not only opens all spreadsheets
this way, but creates a new workbook when Excel is opened and shows the view
as well as any new workbooks created?

Thanks much


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I do page breaks when view menu doesnt page break preview HeatherF55 Excel Discussion (Misc queries) 0 September 21st 07 04:24 AM
change page number watermark in page break preview juga Excel Discussion (Misc queries) 2 December 25th 06 10:16 AM
change and/or remove page number watermark in page break preview juga Excel Discussion (Misc queries) 2 December 25th 06 10:15 AM
print preview v page break preview SamB Excel Discussion (Misc queries) 0 November 16th 06 05:09 PM
Hiding the page number in page break preview background. I need coffee, wake me up! Excel Discussion (Misc queries) 0 May 15th 06 10:32 AM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"