ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide "Excel" when running VB (https://www.excelbanter.com/excel-programming/328459-hide-excel-when-running-vbulletin.html)

Old Car

Hide "Excel" when running VB
 
Is there a way to hide "Excel" when its VB code is running? Thanks.



Jim Thomlinson[_3_]

Hide "Excel" when running VB
 
application.visible = false

Careful with this though. Make sure you have proper error handling. If your
code crashes... Your excel will not come back...

HTH

"Old Car" wrote:

Is there a way to hide "Excel" when its VB code is running? Thanks.




Tom Ogilvy

Hide "Excel" when running VB
 
At the start of your code
Application.Visible = False

At the end of your code
Application.Visible = True

--
Regards,
Tom Ogilvy

"Old Car" wrote in message
news:rAuce.73$k01.46@trnddc03...
Is there a way to hide "Excel" when its VB code is running? Thanks.





Chip Pearson

Hide "Excel" when running VB
 
Do you mean to hide the entire application? If so, use

Application.Visible = False
' your code here
Application.Visible = True

If you mean to simply hide the interim results of a VBA procedure
while it is running, use

Application.ScreenUpdating = False
' your code here
Application.ScreenUpdating = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Old Car" wrote in message
news:rAuce.73$k01.46@trnddc03...
Is there a way to hide "Excel" when its VB code is running?
Thanks.





Charlie

Hide "Excel" when running VB
 
....or if you are debugging your app and break out, same thing... You will
need to go into Task Manager (Ctrl+Alt+Del), find the EXCEL.EXE under
Processes tab and click <End Process

"Jim Thomlinson" wrote:

application.visible = false

Careful with this though. Make sure you have proper error handling. If your
code crashes... Your excel will not come back...

HTH

"Old Car" wrote:

Is there a way to hide "Excel" when its VB code is running? Thanks.




Jim Thomlinson[_3_]

Hide "Excel" when running VB
 
True, but at that point you still have the VBE and you can do a simple sub to
bring the Excel back to visible. If your code is protected and you crash then
there is no VBE and no way to reset the visible property. Unless Tom or Chip
knows one... They always know that kind of stuff... ;-)

HTH

"Charlie" wrote:

...or if you are debugging your app and break out, same thing... You will
need to go into Task Manager (Ctrl+Alt+Del), find the EXCEL.EXE under
Processes tab and click <End Process

"Jim Thomlinson" wrote:

application.visible = false

Careful with this though. Make sure you have proper error handling. If your
code crashes... Your excel will not come back...

HTH

"Old Car" wrote:

Is there a way to hide "Excel" when its VB code is running? Thanks.




Peter T

Hide "Excel" when running VB
 
Obviously this should never happen, but just in case -

Assuming the hidden instance of Excel is the only running instance it should
be possible to make it visible again using a macro in Word:

Sub XLvisible()
Dim oXL As Object
On Error Resume Next
Set oXL = GetObject(, "Excel.Application")
oXL.Visible = True
If oXL Is Nothing Or Err.Number < 0 Then
MsgBox "Couldn't get Excel"
End If
End Sub

Or just a simple VBS. Copy following in a text editor and save with a .vbs
extension, eg "XLvisible.vbs"

On Error Resume Next
Set oXL = GetObject(, "Excel.Application")
If TypeName(oXL) = "Empty" Then
Msgbox "Couldn't get Excel"
Else
oXL.Visible = True
End If

If the hidden instance is one of multiple Excel instances it's a lot more
complicated.

Regards,
Peter T

"Jim Thomlinson" wrote in message
...
True, but at that point you still have the VBE and you can do a simple sub

to
bring the Excel back to visible. If your code is protected and you crash

then
there is no VBE and no way to reset the visible property. Unless Tom or

Chip
knows one... They always know that kind of stuff... ;-)

HTH

"Charlie" wrote:

...or if you are debugging your app and break out, same thing... You

will
need to go into Task Manager (Ctrl+Alt+Del), find the EXCEL.EXE under
Processes tab and click <End Process

"Jim Thomlinson" wrote:

application.visible = false

Careful with this though. Make sure you have proper error handling. If

your
code crashes... Your excel will not come back...

HTH

"Old Car" wrote:

Is there a way to hide "Excel" when its VB code is running? Thanks.






Paul

Hide "Excel" when running VB
 
why dont you just minimize the excel window?
--
hope this helps
Paul


"Chip Pearson" wrote:

Do you mean to hide the entire application? If so, use

Application.Visible = False
' your code here
Application.Visible = True

If you mean to simply hide the interim results of a VBA procedure
while it is running, use

Application.ScreenUpdating = False
' your code here
Application.ScreenUpdating = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Old Car" wrote in message
news:rAuce.73$k01.46@trnddc03...
Is there a way to hide "Excel" when its VB code is running?
Thanks.






Robert Bruce[_2_]

Hide "Excel" when running VB
 
Roedd <<paul wedi ysgrifennu:

why dont you just minimize the excel window?


There's a difference between <<hiding and <<crouching down really small
and hoping that no one spots you ;-)

--
Rob

http://www.asta51.dsl.pipex.com/webcam/

This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.




All times are GMT +1. The time now is 02:28 PM.

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