Displaying an Excel userform as a button in the taskbar

前端 未结 2 2101
余生分开走
余生分开走 2021-01-03 04:15

I want to hide the Excel button in the taskbar and display a separate button for my userform so that it feels like an application on its own. I know this has been covered a

相关标签:
2条回答
  • 2021-01-03 04:57

    Simply put the following code in your main UserForm_Initialize sub and it will minimize the Excel application window while leaving your form open on the desktop.

    Private Sub minimizeWindow()
      With Application
        .WindowState = xlMinimized
      End With
    End sub
    
    0 讨论(0)
  • 2021-01-03 05:00

    To answer my own question: the problem was not in the code I posted above, but in the way the userform was loaded. It should be loaded as modeless.

    0 讨论(0)
提交回复
热议问题