Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Disable Format Painter?

Hi All...........

I have protected a worksheet/workbook through the use of the menus, yet
users can still use the Format Painter on the un-protected cells, even tho
the regular formatting options are turned off by the Protection........is
there any way to disable the Format Painter also?..........hopefully
something I could add to the WorkbookOpen Macro......

TIA
Vaya con Dios,
Chuck, CABGx3



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Disable Format Painter?

Hi Chuck,

One way would be to use the workbook activate event to disable thr format
painter and the workbook deactivate event to re-enable it. This way, the
format painter is available to any other workbook.

Right-click the Excel icon to the left of 'File' on your menu bar and paste
the following code into the workbook's ThisWorkbook module.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not ThisWorkbook.Name = "Book.XLT" Then
ThisWorkbook.Names.Add Name:="LastSaved", RefersTo:=Now
ThisWorkbook.Names("LastSaved").Visible = False
Else

End If
End Sub

Private Sub Workbook_Deactivate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = True
End If
Next
End Sub


---
Regards,
Norman.



"CLR" wrote in message
...
Hi All...........

I have protected a worksheet/workbook through the use of the menus, yet
users can still use the Format Painter on the un-protected cells, even tho
the regular formatting options are turned off by the Protection........is
there any way to disable the Format Painter also?..........hopefully
something I could add to the WorkbookOpen Macro......

TIA
Vaya con Dios,
Chuck, CABGx3





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Disable Format Painter?

Hi Chuck,

Cut and paste misfired - operator error!

Replace the previous code with:

Private Sub Workbook_Activate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = False
End If
Next
End Sub


Private Sub Workbook_Deactivate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = True
End If
Next
End Sub

---
Regards,
Norman


"Norman Jones" wrote in message
...
Hi Chuck,

One way would be to use the workbook activate event to disable thr format
painter and the workbook deactivate event to re-enable it. This way, the
format painter is available to any other workbook.

Right-click the Excel icon to the left of 'File' on your menu bar and

paste
the following code into the workbook's ThisWorkbook module.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not ThisWorkbook.Name = "Book.XLT" Then
ThisWorkbook.Names.Add Name:="LastSaved", RefersTo:=Now
ThisWorkbook.Names("LastSaved").Visible = False
Else

End If
End Sub

Private Sub Workbook_Deactivate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = True
End If
Next
End Sub


---
Regards,
Norman.



"CLR" wrote in message
...
Hi All...........

I have protected a worksheet/workbook through the use of the menus, yet
users can still use the Format Painter on the un-protected cells, even

tho
the regular formatting options are turned off by the

Protection........is
there any way to disable the Format Painter also?..........hopefully
something I could add to the WorkbookOpen Macro......

TIA
Vaya con Dios,
Chuck, CABGx3







  #4   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Disable Format Painter?

lolol.............thanks Norman.......I was just delicately trying to
compose a response requesting some "clarification"........this one makes a
LOT more sense, even to my limited VBA grasp..........it really does look
good, and I'm sure it will behave exactly like I want.......

Thanks again muchly.........

Vaya con Dios,
Chuck, CABGx3


"Norman Jones" wrote in message
...
Hi Chuck,

Cut and paste misfired - operator error!

Replace the previous code with:

Private Sub Workbook_Activate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = False
End If
Next
End Sub


Private Sub Workbook_Deactivate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = True
End If
Next
End Sub

---
Regards,
Norman


"Norman Jones" wrote in message
...
Hi Chuck,

One way would be to use the workbook activate event to disable thr

format
painter and the workbook deactivate event to re-enable it. This way, the
format painter is available to any other workbook.

Right-click the Excel icon to the left of 'File' on your menu bar and

paste
the following code into the workbook's ThisWorkbook module.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not ThisWorkbook.Name = "Book.XLT" Then
ThisWorkbook.Names.Add Name:="LastSaved", RefersTo:=Now
ThisWorkbook.Names("LastSaved").Visible = False
Else

End If
End Sub

Private Sub Workbook_Deactivate()
Dim ctl As CommandBarControl
For Each ctl In Application.CommandBars("Standard").Controls
If ctl.Caption = "&Format Painter" Then
ctl.Enabled = True
End If
Next
End Sub


---
Regards,
Norman.



"CLR" wrote in message
...
Hi All...........

I have protected a worksheet/workbook through the use of the menus,

yet
users can still use the Format Painter on the un-protected cells, even

tho
the regular formatting options are turned off by the

Protection........is
there any way to disable the Format Painter also?..........hopefully
something I could add to the WorkbookOpen Macro......

TIA
Vaya con Dios,
Chuck, CABGx3









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
copy conditional format without using format painter MsConfused Excel Worksheet Functions 2 May 4th 09 07:16 AM
Format Painter Fay Excel Discussion (Misc queries) 1 March 14th 08 07:44 PM
how can I use the format painter?? hermosilla New Users to Excel 1 August 11th 06 11:56 PM
Disable format painter in excel 2003 tenchsama New Users to Excel 1 February 8th 05 12:53 AM
format painter gregork Excel Programming 2 February 11th 04 09:58 AM


All times are GMT +1. The time now is 03:12 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"