Command: RemoveUserCommandFromEvent
- Updated2024-09-12
- 1 minute(s) read
Command: RemoveUserCommandFromEvent
Command: RemoveUserCommandFromEvent
Deletes a single user command from a list of user commands which you assigned to an event.
RemoveUserCommandFromEvent(EventName, UserCommandName)
Input Parameters
EventName | String Specifies the name of a DIAdem event. You cannot transfer the event as a reference ("by reference"). |
UserCommandName | String Specifies a user command registered in DIAdem. |
Example
The following example assumes that you registered the two user commands MyFirstCommand and MySecondCommand in DIAdem. Assign both user commands to the event View.Events.OnActiveSheetChanged. When changing the active worksheet in DIAdem VIEW, DIAdem executes the two user commands MyFirstCommand and MySecondCommand. Use the RemoveUserCommandFromEvent command to delete the MyFirstCommand user command from the list of assigned user commands. When changing the active worksheet in DIAdem VIEW, DIAdem only executes the user command MySecondCommand.
VBScript | Python |
Call AddUserCommandToEvent("View.Events.OnActiveSheetChanged","MyFirstCommand") Call AddUserCommandToEvent("View.Events.OnActiveSheetChanged","MySecondCommand") 'Do something Call RemoveUserCommandFromEvent("View.Events.OnActiveSheetChanged","MyFirstCommand")
To not assign a user command to an event anymore, assign an empty string, for example, View.Events.OnActiveSheetChanged= "" to the event.