Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:12:33+00:00 2026-06-01T09:12:33+00:00

I have a workbook A with a macro and set with a shortcut Ctrl+Q,

  • 0

I have a workbook “A” with a macro and set with a shortcut “Ctrl+Q”, when I press “Ctrl+Q” the a form pops up, and when I press “ESC” the form is closed since I added a button “CommandButton1” whose property “Cancel” set to TRUE.

In the code I close the form like this:

Private Sub CommandButton1_Click()
    Unload Me
End Sub

It works well, but the problem is I can’t switch to other opened workbooks until I close the workbook “A”, does anyone knows what the problem is?

thanks very much!

the code is like this:

VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} Get_Photo 
   Caption         =   "abc"
   ClientHeight    =   3120
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4710
   OleObjectBlob   =   "Get_Photo.frx":0000
   StartUpPosition =   1  'CenterOwner
End
Attribute VB_Name = "Get_Photo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub CommandButton1_Click()
    Unload Me
End Sub

Sub UserForm_Initialize()

    With Get_Photo
        .Caption = caption_Name
        .Width = 430
        .Height = 270
    End With

    With WebBrowser1
        .Width = 540
        .Height = 300
        .Navigate ("www.google.com/images/logos/images_logo_lg.gif")
    End With

End Sub

The above form contains a webbrowser and a cancel button.
I added a button in a worksheet with the macro code Get_Photo.Show
when click the button, the form will show with a picture in it.
but when I closed the form after pressing “ESC”, I can’t then switch to other xlsm workbooks, but xlsx workbooks are fine..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:12:35+00:00Added an answer on June 1, 2026 at 9:12 am

    @SiddharthRout, I added more comments to reproduce the problem – aaron 30 mins ago

    Finally, I have been able to reproduce it 🙂 Let me check on it and get back to you. I was not able to switch to other xlsm/xlsx workbook. It kept on showing me the original workbook. The Alt+Tab also refused to work. It’s doesn’t make any exception if I press the commandbutton. – Siddharth Rout 1 min ago edit

    I cannot explain the behavior. Probably it is a bug (However, I haven’t seen any documentation on it yet).

    This will solve your problem. (TRIED AND TESTED)

    Put this 2 extra lines of code in the button code of the worksheet from where you are calling the useeform.

    Private Sub CommandButton1_Click()
        UserForm1.Show
        Application.ShowWindowsInTaskbar = False
        Application.ShowWindowsInTaskbar = True
    End Sub
    

    HTH

    Sid

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that writes many times to a formula/macro-laden workbook. It loops
I have an Excel 2003 workbook that contains a macro to copy certain of
I have a workbook that has many checkboxes (form control) on one tab. I
I have an Excel 2010 macro application that is made up of several workbook
I have a macro in my excel workbook that updates a specific record in
I have a workbook which has a macro that copies some data into a
I have written a macro that searches through workbook and applies an autofilter to
I have an Excel workbook that has a macro (the only macro in the
I have a shared macro-enabled workbook used to conduct quiz. I have the option
I have written a VBA macro in an excel spreadsheet that opens all workbooks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.