views:

49

answers:

2

Is there a way to hide Excel windows from a user - to prevent acidental closing it.

+1  A: 

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.

Patrick Farrell
VBA is the same. Application.visible = false will hide Excel until scripts are done, then show again with Application.visible = true.
guitarthrower
A: 

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.

Nilesh Deshmukh