Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Force page to always display on open (2000 sp3)

    All,
    I have a spreadsheet containing the DATA area and Instruction on use of the file. I want to have the file Always open to a Selection page that has two buttons. This will allow the user to either go to the data page or instruction page.
    Thanks,
    Brad

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Force page to always display on open (2000 sp3)

    Open the VBE (alt-F11) and double click the Thisworkbook module.
    AT the top of the editor window, click the left dropdown and choose Workbook.
    This will automatically insert these two lines of code:

    Private Sub Workbook_Open()
    End Sub

    add a line in between so you get:

    Private Sub Workbook_Open()
    ThisWorkbook.Worksheets("Selection").Activate
    End Sub

    Change the "Selection" part to the name of your selection worksheet.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Force page to always display on open (2000 sp3)

    By "page", do you mean a worksheet?

    You can put code in the Workbook_Open event to activate the Selection worksheet when the workbook is opened:

    - Activate the Visual Basic Editor (Alt+F11)
    - Double click the ThisWorkbook node in the Project Explorer (the treeview on the left hand side).
    - Select Workbook from the dropdown list in the upper left corner of the module window that appears.
    - Complete the event procedure so that it looks like this:

    Private Sub Workbook_Open()
    Worksheets("Selection").Activate
    End Sub

    - Switch back to Excel (Alt+F11)
    - Close and save the workbook.

  4. #4
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Force page to always display on open (2000 sp3)

    Perhaps I do not see something. The below is what I have so far: this is the information before I try what you indicate.

    Hans, this is the one you helped me with recently.

    Once again, I defer to your wisdom.


    Option Explicit

    Private Sub Workbook_Activate()
    On Error Resume Next
    Application.CommandBars("ARA Metrics").Visible = True

    End Sub

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    On Error Resume Next
    Application.CommandBars("ARA Metrics").Delete
    End Sub

    Private Sub Workbook_Deactivate()
    On Error Resume Next
    Application.CommandBars("ARA Metrics").Visible = False
    End Sub

    Private Sub Workbook_Open()

    Dim cbr As CommandBar
    Dim cbb As CommandBarButton
    Set cbr = Application.CommandBars.Add("ARA Metrics")
    'cbr.Top = 72
    'cbr.Left = 780
    cbr.Position = msoBarTop
    'cbr.Position = msoBarRight
    Set cbb = cbr.Controls.Add(msoControlButton)
    With cbb
    .Caption = "ARA Metrics"
    .OnAction = "Select_Form"
    .Style = msoButtonIconAndCaption
    .FaceId = 2950
    End With
    Set cbb = Nothing
    Set cbr = Nothing
    End Sub

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Force page to always display on open (2000 sp3)

    Add the line

    Worksheets("Selection").Activate

    to the existing code in Workbook_Open (at the beginning or at the end, it doesn't matter)

  6. #6
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Force page to always display on open (2000 sp3)

    Hans,

    That did the trick! Thanks!!!!!


    Brad

Posting Permissions

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