+ Reply to Thread
Results 1 to 2 of 2

Start and Open in Page Break PreView

  1. #1
    Sue Hughes
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1