Excel will not close

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,099
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I've truck an oddball problem. My workbook opens ok, and to test I load my Form from the immediate window and close it
If I then attempt close Excel. I get the wait cursor forever and need to Contrl-Alt-Del End task.

Could someone in the know take a look at it please ? I have proved the issue into a demo, but want to discuss macros first
as some may need remming out.

But I'm told I may not post attachments. Can I change that ?

Thanks for any help with this.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I've isolated the problem, I think but it isn't clear why it's happening.

Code:
Private Sub UserForm_Initialize()

MsgBox "Initialise"
Dim i As Long
    For i = 1 To 48
        Me.Frame1.Controls("CommandButton" & Format(i, "00")).Caption = vbNullString
        Me.Frame1.Controls("CommandButton" & Format(i, "00")).Tag = Me.Frame1.Controls("CommandButton" & Format(i, "00")).BackColor
        Set MyClass(i) = New clsPressBtn
        Set MyClass(i).GetForm = Me
        Set MyClass(i).Btn = Me.Frame1.Controls("CommandButton" & Format(i, "00"))
    Next


End Sub

The Form loads/runs correctly. But if the above isn't remmed out (apart from the MsgBox), Excel will not close.
Yet the msgbox does not appear when attempting to close, indicating that code isn't running.

Can anyone help me debug this ?
 
Upvote 0
Excel Problem closing

I have a macro-enabled workbook in Dropbox

https://www.dropbox.com/s/burhl3jawqhj05a/PickerOnly.xlsm?dl=0

Could someone please have a look at this. When it opens a Form loads with a color picker.
The color clicked becomes backcolor to a couple of labels on the Form when clicked.

The problem is (whether the picker is used or not), closing that Form will crash Excel. It will never close after that.
If the Form is not closed first though, Excel will close normally.

I can't figure out why though, or how to correct it. Any help appreciated.
 
Upvote 0
Re: Excel Problem closing

Cross posted https://www.excelforum.com/excel-programming-vba-macros/1267181-code-picker.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Re: Excel Problem closing

Thanks Joe, that clears that up. Fluff, I "crossposted" as you call it as no one had replied here and I *could* include an attachment on the other site. The we no point referencing it there's nothing there except the original question.
Isn't it sad how people can take time out to complain about something ignoring that someone may be trying to get help with a problem.
 
Upvote 0
Re: Excel Problem closing

AlexanderBB

Did you check my response on the other forum?
 
Upvote 0
Re: Excel Problem closing

Please read this to understand the issue with Cross-Posting: https://www.excelguru.ca/content.php?184

As our rules state, it is not a problem if you do it correctly (provide links). Sure there may not be a reply on the other site at a particular point in time, but that can change pretty fast, especially when you are away from the computer for a while.

Two things to remember:
- People volunteer their time responding to questions. No one like to feel like they have wasted their time because the same answer may have already been posted elsewhere, or if the problem has already been answered elsewhere.
- As you can see, there is a lot of cross-over, in that many people post on multiple forums. For the sake of getting replies to your question, you really don't want to develop a reputation, because it does get around to the other sites pretty fast.
 
Upvote 0
Re: Excel Problem closing

Ok Joe, understood. Just reading Nories reply now.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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