Combobox Change On Save As

  • Thread starter Thread starter jbl25
  • Start date Start date
J

jbl25

Hello,
I have a file with a large number of combobox controls on several
sheets. On SaveAs, every combobox change sub runs, which resets many
of the combobox values. I saw in a previous thread that this is due to
the comboboxes being linked to cells, and the recalculate before save.
Even if I turn the autocalculate off before saving, some still change,
and others change when I turn the calculations back on. I need to
store the selections from the comboboxes, so I must link them to cells.
How can I avoid them changing? Thank you!!!
 
You could set an event flag to bypass its action

Public fDisableEvents As Boolean

Private Sub ComboBox1_Change()
If Not fDisableEvents Then
MsgBox ComboBox1.Value
End If
End Sub

and disable the flag before the SaveAs.
 
Maybe in Workbooks_BeforeSave event set Application.Calculation =
xlCalsulationManual ?

I'm not sure why it is preferrable to block of excel calculation,
unless this is a performance issue

DM Unseen
 
Hello,
I tried disabling all workbook events right before saving, and also
tried setting calculations to manual before save, but the comboboxes
still changed. I have excel 2003 and have installed Hotfix SP1. Are
there any other solutions? Thanks very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top