How to stop combo box from running on close

bcmacuser

New Member
Joined
Sep 7, 2010
Messages
16
Hi,

I'm using Excel 2007 and I've spent a number of days to figure this out and it just keeps on popping up despite my best efforts.

I've written a number of functions and subs that work when I change combo boxes as they should. When I think I'm done and then I try and save as, save or just close excel is calling and updating all the combo boxes and giving me errors that didn't appear when I called them as desired.

The specific error I'm getting now is

"Cannot update. Database or object is read-only."

This error is coming from a function I wrote that returns a string by querying a worksheet. I'm happy to give you more details or code that I have but I was wondering what if anyone has run into this and can give me an idea on how to shut these things down when I'm not using them!

FYI - I have tried to set global subs like Private Sub Workbook_BeforeClose(Cancel As Boolean) to return a true flag and not run the code when it is closing but even that isn't working. This might be lack of knowledge on my part but it seems that this is a bug or bigger problem. If it's a bug, I don't mind but I do would like a workaround!

Thank you in advance for any insight or thoughts you have on the subject. It's much appreciated!

- Brendan :biggrin:
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top