ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   View only UserForm? (https://www.excelbanter.com/excel-programming/320080-view-only-userform.html)

Claud Balls

View only UserForm?
 
Is it possible to load a form in the workbook_open event, then make the
excel disappear?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dick Kusleika[_4_]

View only UserForm?
 
Claud

Put

Application.Visible = False

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

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com


Claud Balls wrote:
Is it possible to load a form in the workbook_open event, then make
the excel disappear?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Ken Macksey

View only UserForm?
 
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



Ken Macksey

View only UserForm?
 
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



Dick Kusleika[_2_]

View only UserForm?
 
No problem, Ken, it's a good point.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com


Ken Macksey wrote:
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





All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com