DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

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

EventNameString
Specifies the name of a DIAdem event. You cannot transfer the event as a reference ("by reference").
UserCommandNameString
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.

VBScriptPython

 

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.

Was this information helpful?