Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Runnig Excel without visible application

This was just the thing i've been looking for... but it dosn't work :(
I get a message box that pops up and tells me "Excel Running" .. and
then nothing happens.

I tried moving the "objXL.Visible = true" statement inside the first
If-Else, and that didn't work eaither. <grumble i have a crashed
version of excel sitting in my background somewhere that i need to get
to.

Jon Peltier wrote:
But you can get at that invisible Excel instance in a couple ways.
Ctrl-Alt-Del will give you the list of running apps, but you can only

kill it
from here. The other way was posted by Rob Bruce some time back.

Put this
code into a text file:

' === Begin script ===============
' from Rob Bruce
Dim objXL, strMessage
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If
MsgBox strMessage, vbInformation, "Excel Status"
if strMessage = "Excel Running." then objXL.Visible = true
' === End script ===============

Save it with a name like "XLcheck.vbs". If you have a hidden Excel

instance,
running this script will bring it up front. If there is no such

hidden
instance, it tells you that, too.

- Jon


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Runnig Excel without visible application


wrote in message
oups.com...
This was just the thing i've been looking for... but it dosn't work :(
I get a message box that pops up and tells me "Excel Running" .. and
then nothing happens.

I tried moving the "objXL.Visible = true" statement inside the first
If-Else, and that didn't work eaither. <grumble i have a crashed
version of excel sitting in my background somewhere that i need to get
to.

Jon Peltier wrote:
But you can get at that invisible Excel instance in a couple ways.
Ctrl-Alt-Del will give you the list of running apps, but you can only

kill it
from here. The other way was posted by Rob Bruce some time back.

Put this
code into a text file:

' === Begin script ===============
' from Rob Bruce
Dim objXL, strMessage
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If
MsgBox strMessage, vbInformation, "Excel Status"
if strMessage = "Excel Running." then objXL.Visible = true
' === End script ===============

Save it with a name like "XLcheck.vbs". If you have a hidden Excel

instance,
running this script will bring it up front. If there is no such

hidden
instance, it tells you that, too.

- Jon



I don't think the code will work. The problem is that not all versions of
Excel register themselves in the Running Object Table. If a running
application isn't registered there, GetObject will return NULL. The Soution
to this problem is to get a handle to the main Excel window, called "XLMAIN"
and send the message WM_USER + 18 to it. You can find more information here
http://support.microsoft.com/default...b;EN-US;138723

I also think that the line
If Not TypeName(objXL) = "Empty" Then
should be changed to
If Not objXL is Nothing Then

This is easier to understand.

/Fredrik


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Runnig Excel without visible application

You did put it in a vbs file, not in VBA didn't you?

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
This was just the thing i've been looking for... but it dosn't work :(
I get a message box that pops up and tells me "Excel Running" .. and
then nothing happens.

I tried moving the "objXL.Visible = true" statement inside the first
If-Else, and that didn't work eaither. <grumble i have a crashed
version of excel sitting in my background somewhere that i need to get
to.

Jon Peltier wrote:
But you can get at that invisible Excel instance in a couple ways.
Ctrl-Alt-Del will give you the list of running apps, but you can only

kill it
from here. The other way was posted by Rob Bruce some time back.

Put this
code into a text file:

' === Begin script ===============
' from Rob Bruce
Dim objXL, strMessage
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
If Not TypeName(objXL) = "Empty" Then
strMessage = "Excel Running."
Else
strMessage = "Excel Not Running."
End If
MsgBox strMessage, vbInformation, "Excel Status"
if strMessage = "Excel Running." then objXL.Visible = true
' === End script ===============

Save it with a name like "XLcheck.vbs". If you have a hidden Excel

instance,
running this script will bring it up front. If there is no such

hidden
instance, it tells you that, too.

- Jon




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.Visible = False SimonB Setting up and Configuration of Excel 1 October 16th 06 09:51 PM
Application.Visible = False SimonB Excel Discussion (Misc queries) 1 October 15th 06 01:10 PM
Application.visible help Glen Mettler[_4_] Excel Programming 0 February 16th 05 10:04 PM
Linked Excel Chart within hidden Word Application Visible Obi-Too Excel Programming 0 June 23rd 04 03:58 PM
Runnig a macro when excel opens vman Excel Programming 3 December 18th 03 06:41 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"