View only UserForm?

D

Dick Kusleika

Claud

Put

Application.Visible = False

in the Initialize event of the userform. Be sure to set it back to true in
the QueryClose event.
 
K

Ken Macksey

Hi.

Be careful using application.visible. It is possible to end up with excel
invisible and no easy way to get it back after an error etc.

I have found this code very useful when that happens.

Dim objXL
Dim strMessage

On Error Resume Next

' Try to grab a running instance of
' Excel...
Set objXL = GetObject(, "Excel.Application")

' What did we find?..
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If

' Feedback to user...
MsgBox strMessage, vbInformation, "Excel Status"

' Make the Excel instance visible
' if we found one
if strMessage = "Excel Running." then _
objXL.Visible = true


HTH

Ken
 
K

Ken Macksey

Hi

Sorry dick, I really meant to reply to Clauds post.

I should also have mentioned that the code is vbscript. Save it to the
desktop as something like "activate excel.vbs" using notepad. Then if excel
is ever accidentally invisible, just double click it.

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top