+ Reply to Thread
Results 1 to 2 of 2

how do i do something for every spreadsheet i open?

  1. #1
    Drew Krum
    Guest

    how do i do something for every spreadsheet i open?

    So many spreadsheets come to me with the Reviewing toolbar visible. I've
    created code to make it invisible. How can I have that code run every time I
    open a spreadsheet (attachment, hard drive, ULR)? Every new spreadsheet? When
    I open Excel?

    Thank you,
    Drew

  2. #2
    sebastienm
    Guest

    RE: how do i do something for every spreadsheet i open?

    Hi,

    You can create a small addin or add the following code to an already
    existing one that opens with excel.

    Add a Class module called ClsBarCanceller and paste the following code:

    '---------------------------------------------------------------
    Private WithEvents App As Application

    'When a book opens, hide reviewing toolbar
    Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
    on error resume next
    App.CommandBars("Reviewing").Visible = False
    on error goto 0
    End Sub

    Private Sub Class_Initialize()
    Set App = Application
    End Sub

    Private Sub Class_Terminate()
    Set App = Nothing
    End Sub
    '-------------------------------------------------

    and in a regular code module, add the public object variable:

    '--------------------------------------------------
    Public BarCanceller As New ClsBarCanceller
    '--------------------------------------------------

    Now, if you added the above code to an already existing addin, it will work
    by itself.
    If it is a new one, set its IsAddin property to True (select ThisWorkbook in
    the project explorer and set the property in the Properties Window). Finally
    save the book and copy it in the xlstart folder:
    C:\Documents and Settings\<USERNAME>\Application
    Data\Microsoft\Excel\XLSTART
    with <USERNAME> being your Windows login name.
    This will make it open each time excel opens and will make the code active.

    I hope this helps,

    Regards,
    Sébastien

    "Drew Krum" wrote:

    > So many spreadsheets come to me with the Reviewing toolbar visible. I've
    > created code to make it invisible. How can I have that code run every time I
    > open a spreadsheet (attachment, hard drive, ULR)? Every new spreadsheet? When
    > I open Excel?
    >
    > Thank you,
    > Drew


+ 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