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: 12
Default Code Only Works on Certain Sheets Within a Workbook

I have the following code saved in a file on a network to add an item to the
cell shortcut list once right-clicked.

ThisWorkbook code

Private Sub Workbook_Activate()
AddItemToShortcut
End Sub

Private Sub Workbook_Deactivate()
ResetCellShortcut
End Sub

Sub AddItemToShortcut()

Dim NewItem As CommandBarControl
Set NewItem = CommandBars("Cell").Controls.Add(Type:=1, Befo=1,
Temporary:=True)
NewItem.Caption = "Add New Date"
NewItem.OnAction = "NewDate"
NewItem.BeginGroup = True

End Sub

Sub ResetCellShortcut()

CommandBars("Cell").Reset

End Sub

I believe the "Add New Date" feature should be available on any sheet within
the workbook once a cell is right-clicked. However, this function is only
available on certain sheets within the workbook.

This file is on a network, and multiple users are opening and closing the
file. Could this have lead to the issue? I also have previously saved a
test file on my desktop with the exact same code in it which works fine.
This led me to believe having multiple users open it could have created the
problem.

Thanks
 
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
Workbook code works on my machine but noy others John Excel Programming 6 August 19th 09 05:28 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM


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