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 lock or close t.bars for a workbook?

I want to close the toolbars that is open in Excel when a certain book is
opened. I don't have a problem closing all toolbars and opening all again
when you exit book.

I want VB to select the open ones and replace on exit again.

Any help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default How do I lock or close t.bars for a workbook?

HI,
From Google

| Public TBVis() As Boolean
|
| Sub RemoveToolBars()
| ReDim TBVis(Application.Toolbars.Count)
| For x = 1 To Application.Toolbars.Count
| TBVis(x) = Application.Toolbars(x).Visible
| Application.Toolbars(x).Visible = False
| Next x
| End Sub
|
| Sub RestoreToolBars()
| On Error Resume Next
| For x = 1 To Application.Toolbars.Count
| Application.Toolbars(x).Visible = TBVis(x)
| Next x
| End Sub
|
Regards
JY
"Mr.G" wrote in message
...
I want to close the toolbars that is open in Excel when a certain book is
opened. I don't have a problem closing all toolbars and opening all again
when you exit book.

I want VB to select the open ones and replace on exit again.

Any help?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How do I lock or close t.bars for a workbook?

J-Y

Thanks but doesn't work. Don't bombard me now.I'm still newbee with VB.
Your first line breaks it a statement on its own when I insert on WB open.

Anymore help?

"Jean-Yves" wrote:

HI,
From Google

| Public TBVis() As Boolean
|
| Sub RemoveToolBars()
| ReDim TBVis(Application.Toolbars.Count)
| For x = 1 To Application.Toolbars.Count
| TBVis(x) = Application.Toolbars(x).Visible
| Application.Toolbars(x).Visible = False
| Next x
| End Sub
|
| Sub RestoreToolBars()
| On Error Resume Next
| For x = 1 To Application.Toolbars.Count
| Application.Toolbars(x).Visible = TBVis(x)
| Next x
| End Sub
|
Regards
JY
"Mr.G" wrote in message
...
I want to close the toolbars that is open in Excel when a certain book is
opened. I don't have a problem closing all toolbars and opening all again
when you exit book.

I want VB to select the open ones and replace on exit again.

Any help?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I lock or close t.bars for a workbook?

Hi
For me worked almost fine, it missed one, I'm triyng to find why.
PP

"Mr.G" wrote:

J-Y

Thanks but doesn't work. Don't bombard me now.I'm still newbee with VB.
Your first line breaks it a statement on its own when I insert on WB open.

Anymore help?

"Jean-Yves" wrote:

HI,
From Google

| Public TBVis() As Boolean
|
| Sub RemoveToolBars()
| ReDim TBVis(Application.Toolbars.Count)
| For x = 1 To Application.Toolbars.Count
| TBVis(x) = Application.Toolbars(x).Visible
| Application.Toolbars(x).Visible = False
| Next x
| End Sub
|
| Sub RestoreToolBars()
| On Error Resume Next
| For x = 1 To Application.Toolbars.Count
| Application.Toolbars(x).Visible = TBVis(x)
| Next x
| End Sub
|
Regards
JY
"Mr.G" wrote in message
...
I want to close the toolbars that is open in Excel when a certain book is
opened. I don't have a problem closing all toolbars and opening all again
when you exit book.

I want VB to select the open ones and replace on exit again.

Any help?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default How do I lock or close t.bars for a workbook?

Hi all

As I have option explicit (all varaiable have to be declared)
x as to be declared as well
Option Explicit

Public TBVis() As Boolean

Sub RemoveToolBars()
ReDim TBVis(Application.Toolbars.Count)
Dim x As Integer
For x = 1 To Application.Toolbars.Count
TBVis(x) = Application.Toolbars(x).Visible
Application.Toolbars(x).Visible = False
Next x
End Sub

Sub RestoreToolBars()
On Error Resume Next
Dim x As Integer
For x = 1 To Application.Toolbars.Count
Application.Toolbars(x).Visible = TBVis(x)
Next x
End Sub

Regards
JY
"Paulo Alexandre ( PT )" wrote
in message ...
Hi
For me worked almost fine, it missed one, I'm triyng to find why.
PP

"Mr.G" wrote:

J-Y

Thanks but doesn't work. Don't bombard me now.I'm still newbee with VB.
Your first line breaks it a statement on its own when I insert on WB
open.

Anymore help?

"Jean-Yves" wrote:

HI,
From Google

| Public TBVis() As Boolean
|
| Sub RemoveToolBars()
| ReDim TBVis(Application.Toolbars.Count)
| For x = 1 To Application.Toolbars.Count
| TBVis(x) = Application.Toolbars(x).Visible
| Application.Toolbars(x).Visible = False
| Next x
| End Sub
|
| Sub RestoreToolBars()
| On Error Resume Next
| For x = 1 To Application.Toolbars.Count
| Application.Toolbars(x).Visible = TBVis(x)
| Next x
| End Sub
|
Regards
JY
"Mr.G" wrote in message
...
I want to close the toolbars that is open in Excel when a certain book
is
opened. I don't have a problem closing all toolbars and opening all
again
when you exit book.

I want VB to select the open ones and replace on exit again.

Any help?







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default How do I lock or close t.bars for a workbook?

Hi all

I don't know , it gives me a error.
Ambiguous name detected:RemoveToolBars

Maybe this is the problem.I do not have VB installed.I'm using VBE and VBA
in Excel.

Maybe someone has a different solution. I've written a small program and I
don't
want anyone to fiddle.I have locked the all that can be locked and that is
fine.
But now when the welcome note displays, it doesn't close the area in the
sheet on all CPU's the same. Sometimes only half of the area is closed.

Any help?

"Jean-Yves" wrote:

Hi all

As I have option explicit (all varaiable have to be declared)
x as to be declared as well
Option Explicit

Public TBVis() As Boolean

Sub RemoveToolBars()
ReDim TBVis(Application.Toolbars.Count)
Dim x As Integer
For x = 1 To Application.Toolbars.Count
TBVis(x) = Application.Toolbars(x).Visible
Application.Toolbars(x).Visible = False
Next x
End Sub

Sub RestoreToolBars()
On Error Resume Next
Dim x As Integer
For x = 1 To Application.Toolbars.Count
Application.Toolbars(x).Visible = TBVis(x)
Next x
End Sub

Regards
JY
"Paulo Alexandre ( PT )" wrote
in message ...
Hi
For me worked almost fine, it missed one, I'm triyng to find why.
PP

"Mr.G" wrote:

J-Y

Thanks but doesn't work. Don't bombard me now.I'm still newbee with VB.
Your first line breaks it a statement on its own when I insert on WB
open.

Anymore help?

"Jean-Yves" wrote:

HI,
From Google

| Public TBVis() As Boolean
|
| Sub RemoveToolBars()
| ReDim TBVis(Application.Toolbars.Count)
| For x = 1 To Application.Toolbars.Count
| TBVis(x) = Application.Toolbars(x).Visible
| Application.Toolbars(x).Visible = False
| Next x
| End Sub
|
| Sub RestoreToolBars()
| On Error Resume Next
| For x = 1 To Application.Toolbars.Count
| Application.Toolbars(x).Visible = TBVis(x)
| Next x
| End Sub
|
Regards
JY
"Mr.G" wrote in message
...
I want to close the toolbars that is open in Excel when a certain book
is
opened. I don't have a problem closing all toolbars and opening all
again
when you exit book.

I want VB to select the open ones and replace on exit again.

Any help?






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
Deleting Command Bars on close of a workbook Stan Bottorff Excel Programming 1 November 6th 05 04:13 AM
Help on Workbook close and workbook save events Adam Harding Excel Programming 1 September 29th 05 04:12 PM
Hide all Excel tool/command bars except mine and reload on close Matt Jensen Excel Programming 2 December 20th 04 05:44 PM
Close a the current workbook and load another specified workbook Adrian[_7_] Excel Programming 4 August 7th 04 05:29 PM
Close button on Custom Menu Bars Aaron[_6_] Excel Programming 2 July 18th 03 03:58 AM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"