Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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
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
spreadsheet does not open Rossygirl Excel Discussion (Misc queries) 1 February 23rd 10 01:11 PM
How do I open a spreadsheet? Pleasehelp Excel Discussion (Misc queries) 6 November 5th 08 06:40 PM
Spreadsheet will not open without Excel Application being open fir Deirdre Lysaght Excel Discussion (Misc queries) 1 November 13th 07 04:11 PM
Help! I can't get a spreadsheet to open [email protected] New Users to Excel 1 August 20th 06 10:02 PM
How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Excel Programming 0 July 13th 03 01:59 PM


All times are GMT +1. The time now is 07:59 PM.

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"