Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
spreadsheet does not open | Excel Discussion (Misc queries) | |||
How do I open a spreadsheet? | Excel Discussion (Misc queries) | |||
Spreadsheet will not open without Excel Application being open fir | Excel Discussion (Misc queries) | |||
Help! I can't get a spreadsheet to open | New Users to Excel | |||
How to open another Excel spreadsheet to copy data into current spreadsheet ? | Excel Programming |