#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protection

Hi to all, do you know if any way to remove the Visual Basic tool bar from a file, I did in my file, but when the users open my file in their computer, the Visual Basic bar is there, How can I save the properties of the file and keep them in all computers

Thanks this place is a excelent!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Protection

Hi Francisco,

I suspect that managing the visible property will serve
your purpose. The following is something I've used:

'******* CLOSE & RESTORE TOOLBARS **********
'ToolBar_List is a defined name, 1 cell range
'on worksheet #1
Sub CloseToolbars() 'CALL FROM AUTO_OPEN MACRO
Dim Oset As Integer
On Error GoTo TBCloseError
Oset = 1
ThisWorkbook.Worksheets(1). _
Range("ToolBar_List").CurrentRegion. _
Offset(1, 0).ClearContents
For Each t In CommandBars
If t.BuiltIn And t.Visible And _
t.Name < "Worksheet Menu Bar" Then
ThisWorkbook.Worksheets(1). _
Range("ToolBar_List"). _
Offset(Oset, 0).Value = t.Name
t.Visible = False
Oset = Oset + 1
End If
Next
Exit Sub
TBCloseError:
MsgBox "Close ToolBar Error"
End Sub

Sub RestoreToolbars() 'CALL FROM AUTO_CLOSE MACRO
Dim R As Object
On Error GoTo TBRestoreError
Set R = ThisWorkbook.Worksheets(1). _
Range("ToolBar_List"). _
CurrentRegion.Offset(1, 0)
For Each C In R.Resize(R.Rows.Count - 1, 1)
CommandBars(C.Value).Visible = True
Next
R.ClearContents
Set R = Nothing
Exit Sub
TBRestoreError:
Set R = Nothing
End Sub

Francisco, if you really want to lock out the user's
access to toolbars, consider using the enabled property
instead of the visible property.

Best Regards,
Walt

-----Original Message-----
Hi to all, do you know if any way to remove the Visual

Basic tool bar from a file, I did in my file, but when the
users open my file in their computer, the Visual Basic bar
is there, How can I save the properties of the file and
keep them in all computers?


Thanks this place is a excelent!
.

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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
WS Protection: Different Levels of Protection on Different Ranges Carmi Excel Discussion (Misc queries) 4 August 31st 07 02:26 PM
Cell Protection vs. Worksheet Protection kmwhitt Excel Discussion (Misc queries) 4 September 24th 06 02:37 AM
Worksheet protection is gone and only wokbook protection can be se Eric C. Excel Discussion (Misc queries) 4 May 2nd 06 04:50 PM


All times are GMT +1. The time now is 04:39 AM.

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"