|
-
May 18th, 2001, 09:20 AM
#1
Thread Starter
New Member
-
May 18th, 2001, 09:50 AM
#2
well an easy way:
On error goto ErrH
AppActivate "Excel",1
me.setfocus
exit sub
ErrH:
Msgbox "Excel Is not running"
im sure there is a much more accurate way...this was just a simple one
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
May 18th, 2001, 09:58 AM
#3
Thread Starter
New Member
Thank you!!!!
-
May 18th, 2001, 10:07 AM
#4
Fanatic Member
Alternatively...
Code:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long
If FindWindow("XLMAIN", 0) > 0 Then
MsgBox "Excel is Running!"
End If
-
May 18th, 2001, 10:15 AM
#5
Hyperactive Member
-
May 18th, 2001, 10:23 AM
#6
Fanatic Member
I can't remember where I found the class names, but I saved them in Excel so I wouldn't have to do it again. The ones I've got are:
Code:
Application Class Name
CALC.EXE SciCalc
CALENDAR.EXE CalWndMain
CARDFILE.EXE Cardfile
CLIPBOARD.EXE Clipboard
CLOCK.EXE Clock
CONTROL.EXE CtlPanelClass
EXCEL.EXE XLMain
EXPLORER.EXE ExploreWClass
MS-DOS.EXE Session
NOTEPAD.EXE Notepad
PBRUSH.EXE pbParent
PBRUSH.EXE MSPaintApp
PIFEDIT.EXE Pif
PRINTMAN.EXE PrintManager
PROGMAN.EXE Progman
RECORDER.EXE Recorder
REVERSI.EXE Reversi
SETUP.EXE #32770
SOL.EXE Solitaire
TERMINAL.EXE Terminal
WINFILE.EXE WFS_Frame
WINHELP.EXE MW_WINHELP
WINVER.EXE #32770
WINWORD.EXE OpusApp
WORDPAD.EXE WordPadClass
WRITE.EXE MSWRITE_MENU
How they came up with "OpusApp" for Word, I'll never know...
-
May 18th, 2001, 10:38 AM
#7
Hyperactive Member
Thank you very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very much !!!
If things were easy, users might be programmers.
-
May 18th, 2001, 10:53 AM
#8
Fanatic Member
My pleasure.
FWIW, I think I might have got those names by searching MSDN for "FindWindow". It'd be worth a try, anyway.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|