|
|
Rank: Newbie Groups: Member
Joined: 10/11/2011 Posts: 4 Location: Vancouver
|
Hi,
I have a display with a CommandButton on it. In the properties windows it has its name listed and in the VB code I have the appropriate function for the Click event.
The CommandButton is named CmdAcknowledge and the following is the function:
Private Sub CmdAcknowledge_Click() Exit Sub
The function never gets called and the same goes for all the buttons on the display. The same code however works for an earlier version of the file that doesn't include some new GUI additions. Why would the extra GUI affect my buttons from firing their events? Even when I try to create a new button and fire an event it doesn't work. If you could point me in any kind of direction that would be much appreciated. Thanks.
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
I've found that in some cases a display can become totally unresponsive(corrupt), what we normally do is copy everything from one display and paste it into a new display, including the VBA code, try this and lut us know.
|
|
|
Rank: Newbie Groups: Member
Joined: 10/11/2011 Posts: 4 Location: Vancouver
|
I tried that approach with no luck. There are only two buttons on my display so what I did was try to add new buttons and assign macro's from a module to them and then just reference the display sheet everytime theres a Me. statement. The problem I'm having with this however is that it's telling me that the object reference is invalid or cannot be found. Under the Display Objects folder in my project, the display object is named "ThisDisplay", however when I look in the Object Browser, I only see a display object named "thisDisplay". It looks like that is the correct display object because it contains all the macro's that I would expect, but when I try to use this code it gives me the object library invalid message.
Dim disp As Display Set disp = Application.ActiveProcBook.Displays.Item(thisDisplay) disp.Refresh 'for example
Do you think that this is also due to the fact that the display is just corrupt? Thanks for the input.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Have you got any missing references (Tools -> References) or any strange references there that shouldn't be there? Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 10/11/2011 Posts: 4 Location: Vancouver
|
The version that isn't working has the exact same references as the version that does work. Good suggestion though.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
dwin, in your module, did you use the Private or Public to define you routine
|
|
|
Rank: Newbie Groups: Member
Joined: 10/11/2011 Posts: 4 Location: Vancouver
|
Private but I tried Public and it it gives the same error.
|
|
|
|
Guest
|