Home > OS >  About the Application. The problem of the Visible
About the Application. The problem of the Visible

Time:10-07

Question 1, in Execl2013, use the Application. The Visible=False hidden Execl program, currently open other Execl documents are not Visible,
How to hide the current work thin, don't affect other work thin?
Question 2, Execl2013 different work sheet is not a window, click in the top right corner of the "x" will close the current work thin, if don't want to directly after the point of "x" close work thin, but thin hide the current work, how to do?

CodePudding user response:

The original poster hello, about two issues, please try my method

1. Because the Application reference is Excel ontology, so if it's Visible to False, will cause the Excel is hidden, all documents also could not see, so if we want to hide a Workbook, only to hide ActiveWindow this Object statement is ActiveWindow. Visible=False

2. To achieve this we need to know after clicking on the X, Excel to do what, when the user clicks, Excel will set off a Before the Close time, because this movement is Excel themselves, we want to intervene in the action, you need to want to hide in the Workbook ThisWorkbook Object, writing a process
Private Sub Workbook_BeforeClose (Cancel As Boolean)
Cancel=True
ActiveWindow. Visible=False
End Sub

First to shut down action to Cancel, so Cancel=True, second, click on the window is hidden,

If questions, please continue to post,
  • Related