How to hide Excel window from a user
Is there a way to hide Excel win开发者_如何转开发dows from a user - to prevent acidental closing it.
If you are using OLE automation to control Excel, there is an Application.Visible property that should allow you to hide the window. I can't recall (offhad) whether this is totally hidden or just minimized. If you're in VBA, though, I can't come up with a solution.
I am not sure what the purpose is and how you intend to use but Application.Visible property can be useful. Alternatively you can add a warning message on Workbook_BeforeClose event
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not MsgBox("Do you want to really close this workbook?", vbOKCancel) Then
Workbook_BeforeClose = False
End If
End Sub
Hope this helps... If you could be more elaborate then probably you will have exact solution.
精彩评论