PDA

View Full Version : Save as causing change event on combo box



slondon
05-29-2006, 01:16 PM
When a user selects "Save As" in my workbook, the "Change" event on combo boxes in the workbook seems to be triggered. This does not happen when "Save" is used.

Has anyone ever seen this before? Is there a way to prevent it?

Here is an example of the code behind one of my combo boxes. This workbook contains several similar objects for which this "Save As" problem occurs. In this example, when Save As is selected, Cell J20 reverts to the value in E20. I don't want this to happen. Any thoughts on how to prevent this would be much appreciated.



Private Sub TreatedPatientsOverride_Change()
Worksheets("Patient Population").Range("J20").Value = Worksheets("Patient Population").Range("E20").Value

If TreatedPatientsOverride.Value = Worksheets("Patient Population Worksheet").Range("D51").Value Then
TreatedPatientsBox.Visible = True

Else
TreatedPatientsBox.Visible = False
End If

End Sub

slondon
05-30-2006, 06:51 PM
I have tried several ways to identify the problem. It only seems to be happening with combo boxes and only when Save As is selected (not with Save).

I can work around the problem by creating a separate click button to execute some of my code but this is not a very elegant solution. I really want to understand why this is happening.

I am hoping that someone out there has encountered this problem before.:help