+ Reply to Thread
Results 1 to 10 of 10

in Excel how do you set a workbook to only open on the first work.

  1. #1
    Mark_J
    Guest

    in Excel how do you set a workbook to only open on the first work.

    In Microsoft Excel how do you open a workbook to ensure it only opens one a
    specified worksheet, no matter what spreadsheet you last saved the workbook
    in.

  2. #2
    Forum Contributor
    Join Date
    02-15-2005
    Location
    Blackpool, UK
    Posts
    137
    Hi,

    put a bit of VBA in to your workbook:
    Please Login or Register  to view this content.
    You need to replace sheet name withthe name of the sheet you want, for example:

    Sheets("Sheet1").Activate

    HTH

    Art

  3. #3
    Gordon
    Guest

    Re: in Excel how do you set a workbook to only open on the first work.

    Mark_J wrote:
    || In Microsoft Excel how do you open a workbook to ensure it only
    || opens one a specified worksheet, no matter what spreadsheet you last
    || saved the workbook in.

    I've never heard that that's possible.

    --
    Interim Systems and Management Accounting
    Gordon Burgess-Parker
    Director
    www.gbpcomputing.co.uk



  4. #4
    Biff
    Guest

    Re: in Excel how do you set a workbook to only open on the first work.

    Hi!

    It's possible but requires VBA code.

    Biff

    >-----Original Message-----
    >Mark_J wrote:
    >|| In Microsoft Excel how do you open a workbook to

    ensure it only
    >|| opens one a specified worksheet, no matter what

    spreadsheet you last
    >|| saved the workbook in.
    >
    >I've never heard that that's possible.
    >
    >--
    >Interim Systems and Management Accounting
    >Gordon Burgess-Parker
    >Director
    >www.gbpcomputing.co.uk
    >
    >
    >.
    >


  5. #5
    Dave Peterson
    Guest

    Re: in Excel how do you set a workbook to only open on the first work.

    With a macro, kind of like this...

    Option Explicit
    sub auto_open()
    worksheets("myfavoritesheet").select
    end sub

    Change the name to match your worksheet.

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Mark_J wrote:
    >
    > In Microsoft Excel how do you open a workbook to ensure it only opens one a
    > specified worksheet, no matter what spreadsheet you last saved the workbook
    > in.


    --

    Dave Peterson

  6. #6
    Registered User
    Join Date
    12-16-2004
    Posts
    15
    Where exactly does the code go?

  7. #7
    jenkinspat
    Guest

    Re: in Excel how do you set a workbook to only open on the first work.


    Mark_J Wrote:
    > In Microsoft Excel how do you open a workbook to ensure it only opens
    > one a
    > specified worksheet, no matter what spreadsheet you last saved the
    > workbook
    > in.


    It is VARY do able. In VB go to your project and click the
    ThisWorkbook

    Paste the following-----

    Option Explicit

    Private Sub Workbook_Open()
    Sheets("ENTER YOUR WORKSHEET NAME HERE").Select
    End Sub

    Your workbook will open at the sheet you enetered evry time regardless
    when it was saved on.
    Good Luck
    Pat


    --
    jenkinspat

  8. #8
    Mark
    Guest

    Re: in Excel how do you set a workbook to only open on the first w

    Thanks worked a treat. Any ideas on how I can stop access to the options in
    a protected worksheet/workbook?

    Kind Regards...Mark

    "jenkinspat" wrote:

    >
    > Mark_J Wrote:
    > > In Microsoft Excel how do you open a workbook to ensure it only opens
    > > one a
    > > specified worksheet, no matter what spreadsheet you last saved the
    > > workbook
    > > in.

    >
    > It is VARY do able. In VB go to your project and click the
    > ThisWorkbook
    >
    > Paste the following-----
    >
    > Option Explicit
    >
    > Private Sub Workbook_Open()
    > Sheets("ENTER YOUR WORKSHEET NAME HERE").Select
    > End Sub
    >
    > Your workbook will open at the sheet you enetered evry time regardless
    > when it was saved on.
    > Good Luck
    > Pat
    >
    >
    > --
    > jenkinspat
    >


  9. #9
    Mark
    Guest

    Re: in Excel how do you set a workbook to only open on the first w

    Thanks Dave work a treat. Any ideas on how I can stop people accessing the
    options in a protected worksheet or workbook?

    Kind Regards...Mark

    "Dave Peterson" wrote:

    > With a macro, kind of like this...
    >
    > Option Explicit
    > sub auto_open()
    > worksheets("myfavoritesheet").select
    > end sub
    >
    > Change the name to match your worksheet.
    >
    > If you're new to macros, you may want to read David McRitchie's intro at:
    > http://www.mvps.org/dmcritchie/excel/getstarted.htm
    >
    > Mark_J wrote:
    > >
    > > In Microsoft Excel how do you open a workbook to ensure it only opens one a
    > > specified worksheet, no matter what spreadsheet you last saved the workbook
    > > in.

    >
    > --
    >
    > Dave Peterson
    >


  10. #10
    Dave Peterson
    Guest

    Re: in Excel how do you set a workbook to only open on the first w

    You can stop the users from getting to Tools|options with code like:

    Option Explicit
    Private Sub Workbook_Activate()
    Dim myID As Long
    myID = 522 '&Options...
    Call EnableDisableByID(myID, False)
    End Sub
    Private Sub Workbook_Deactivate()
    Dim myID As Long
    myID = 522 '&Options...
    Call EnableDisableByID(myID, True)
    End Sub

    Sub EnableDisableByID(myID As Long, TurnOn As Boolean)
    Dim myCommandBar As CommandBar
    Dim myCtrl As CommandBarControl

    For Each myCommandBar In Application.CommandBars
    Set myCtrl = myCommandBar.FindControl(ID:=myID, recursive:=True)
    If myCtrl Is Nothing Then
    'do nothing
    Else
    myCtrl.Enabled = TurnOn
    End If
    Next myCommandBar
    End Sub

    You can plop all 3 subs right into the ThisWorkbook module. (The last one could
    go into a general module, instead.)

    But personally, I think won't stop any user who can find the newsgroups.



    Mark wrote:
    >
    > Thanks Dave work a treat. Any ideas on how I can stop people accessing the
    > options in a protected worksheet or workbook?
    >
    > Kind Regards...Mark
    >
    > "Dave Peterson" wrote:
    >
    > > With a macro, kind of like this...
    > >
    > > Option Explicit
    > > sub auto_open()
    > > worksheets("myfavoritesheet").select
    > > end sub
    > >
    > > Change the name to match your worksheet.
    > >
    > > If you're new to macros, you may want to read David McRitchie's intro at:
    > > http://www.mvps.org/dmcritchie/excel/getstarted.htm
    > >
    > > Mark_J wrote:
    > > >
    > > > In Microsoft Excel how do you open a workbook to ensure it only opens one a
    > > > specified worksheet, no matter what spreadsheet you last saved the workbook
    > > > in.

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    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