LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Deactivate / Reactivate the Paste Function in excel

Hi,

I have a macro that deactivates the paste function in excel.
The re-activation of the paste function occurs before the file is
close (beforeclose), see below.
I have applied this to multiple workbooks, but I noticed that when I
have multiple workbook open, if I close one workbook then the paste
function is effective switch back on. Is there a way around this?

Instead of beforeclose could I trigger the re-activation only when
excel is shut down completely?

Thank you

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Enable the menu:
Application.CommandBars("Edit").Controls(3).Enable d = True
Application.CommandBars("Edit").Controls(4).Enable d = True
Application.CommandBars("Edit").Controls(5).Enable d = True
Application.CommandBars("Edit").Controls(6).Enable d = True
' Enable the commandbar:
Application.CommandBars("Standard").Controls(7).En abled = True
Application.CommandBars("Standard").Controls(8).En abled = True
Application.CommandBars("Standard").Controls(9).En abled = True
Application.CommandBars("Standard").Controls(10).E nabled = True
' Enable the shortcut keys:
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "^x"
Application.CommandBars("Cell").Enabled = True

End Sub
 
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
Deactivate a macro when used and reactivate again Ber Excel Discussion (Misc queries) 1 April 23rd 10 04:35 PM
How do I reactivate "Save On Exit" in Excel 2007? Tom Edelbrok Excel Discussion (Misc queries) 3 November 19th 09 06:39 PM
How do I reactivate my undo and redo functions in Excel? Andliz Excel Discussion (Misc queries) 1 February 24th 09 04:49 PM
reactivate DialogBox oldLearner57 Excel Discussion (Misc queries) 1 September 15th 08 01:02 AM
Deactivate then Reactivate UpdateLinks TOMB Excel Programming 2 February 24th 06 10:20 PM


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