error message after saving and closing sheet ..."Can't move focus...."

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
826
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a worksheet in a workbook that I’ve been using for a few years.
In April, I started getting and error message when I use a the macro I’ve used for years to save and close the Sheet (Which closes the workbook..but keeps excel open)

Excel opens to a menu sheet and I click on which sheet I want to go to
After I save and close the sheet, the workbook also closes and the menu sheet is visible
None of my other workbooks or worksheets has the error message

Nothing has changed.
I didn’t add any macros
I’ve used the save and close macro for a long time

If I save and close the worksheet without using the macro, I don't get the error message
Here is the Error message:
Excel Formula:
Can’t move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus


mike
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
It is probably better if you post the macro so we can inspect it, or if it is too big, post the part that does the save operation and where the error occurs. For any error (compile error or runtime error) it is important to report 3 things:

1. Error number
2. Error message
3. Line of code that generates the error. (typically, you would press the 'Debug' button on the error dialog to find the line)

Ref: How to use code tags when posting code.
 
Upvote 0
Solution
Hi rlv01
thanks for the reply. If it applies, have a good holiday!
I looked at the macro and found I had disabled the first line of the code which is

Application.ScreenUpdating =True

but the last line of Application.ScreenUpdating =True
wasn't disabled after i enabled it, it seems to correct the error
I don't remember if that ever happened with any of my other macros in excel
I don't have time till next week to set up a dummy sheet and try to see it it happens again.

The error message had no number.
It came on after the sheet/workbook had closed and the previous sheet became visible.
When Excel opens. A "menu" sheet opens first.
(It has the name of sheets/workbooks that I frequent often..I just click on the name of what i want opened. it has macros that will open the sheet/workbook tied to their name)
When the sheet/workbook closes, the menu sheet becomes visible again
I didn't understand what was meant by "Focus"
If it happens again, I will check each line of code to see if that's what is causing it.
If not, "I'll be back !!!"
thanks again

mike
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
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