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? |
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? |
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? |
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? |
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? |
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? |
How do I lock or close t.bars for a workbook?
HI,
The error "ambiguous name detected" comes if the same name (ie RemoveToolBars) is used mored than once to declare a sub. Where is it located. Press the CTRL key + F, and sear the all project to search for RemoveToolBars. Where do you have code ? Regards JY "Mr.G" wrote in message ... 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? |
How do I lock or close t.bars for a workbook?
JY sorry went away for a while will look at it in a week or two and let you
know. Thanx G "Jean-Yves" wrote: HI, The error "ambiguous name detected" comes if the same name (ie RemoveToolBars) is used mored than once to declare a sub. Where is it located. Press the CTRL key + F, and sear the all project to search for RemoveToolBars. Where do you have code ? Regards JY "Mr.G" wrote in message ... 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? |
How do I lock or close t.bars for a workbook?
JY is it possible for me to mail you the page it still doesn't work?
"Mr.G" wrote: JY sorry went away for a while will look at it in a week or two and let you know. Thanx G "Jean-Yves" wrote: HI, The error "ambiguous name detected" comes if the same name (ie RemoveToolBars) is used mored than once to declare a sub. Where is it located. Press the CTRL key + F, and sear the all project to search for RemoveToolBars. Where do you have code ? Regards JY "Mr.G" wrote in message ... 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? |
How do I lock or close t.bars for a workbook?
Hi,
Try : jean-yvesDOTtfelt AT eurocontrolDOTint change DOT & AT Regards Jean-Yves "Mr.G" wrote in message ... JY is it possible for me to mail you the page it still doesn't work? "Mr.G" wrote: JY sorry went away for a while will look at it in a week or two and let you know. Thanx G "Jean-Yves" wrote: HI, The error "ambiguous name detected" comes if the same name (ie RemoveToolBars) is used mored than once to declare a sub. Where is it located. Press the CTRL key + F, and sear the all project to search for RemoveToolBars. Where do you have code ? Regards JY "Mr.G" wrote in message ... 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? |
How do I lock or close t.bars for a workbook?
Got it!!!!!!!!!!!
Dim c As CommandBar For Each c In commandBars c.Enabled=False Next c I'm sorry was suppose to say commandbars instead of toolbars. Thanx "Jean-Yves" wrote: Hi, Try : jean-yvesDOTtfelt AT eurocontrolDOTint change DOT & AT Regards Jean-Yves "Mr.G" wrote in message ... JY is it possible for me to mail you the page it still doesn't work? "Mr.G" wrote: JY sorry went away for a while will look at it in a week or two and let you know. Thanx G "Jean-Yves" wrote: HI, The error "ambiguous name detected" comes if the same name (ie RemoveToolBars) is used mored than once to declare a sub. Where is it located. Press the CTRL key + F, and sear the all project to search for RemoveToolBars. Where do you have code ? Regards JY "Mr.G" wrote in message ... 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? |
How do I lock or close t.bars for a workbook?
Glad you got it to work
Regards JY "Mr.G" wrote in message ... Got it!!!!!!!!!!! Dim c As CommandBar For Each c In commandBars c.Enabled=False Next c I'm sorry was suppose to say commandbars instead of toolbars. Thanx "Jean-Yves" wrote: Hi, Try : jean-yvesDOTtfelt AT eurocontrolDOTint change DOT & AT Regards Jean-Yves "Mr.G" wrote in message ... JY is it possible for me to mail you the page it still doesn't work? "Mr.G" wrote: JY sorry went away for a while will look at it in a week or two and let you know. Thanx G "Jean-Yves" wrote: HI, The error "ambiguous name detected" comes if the same name (ie RemoveToolBars) is used mored than once to declare a sub. Where is it located. Press the CTRL key + F, and sear the all project to search for RemoveToolBars. Where do you have code ? Regards JY "Mr.G" wrote in message ... 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? |
All times are GMT +1. The time now is 04:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com