LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Finding Excel application handle

Hi Mark,
GetObject is used to find "running programs" and creates a "handle" to the
object. (object or instance)
If the program is not running it will create a new object.

The second example I posted is right out of VB6 and does all the proper
error checking.
It tests to see if Excel is running and if it is it assigns an object name
to it. (MyXL)
The only "problem" with the code is it will not find more than 1 instance.
Or perhaps I should say it stops after finding the first instance.
The code I pointed to with the previous link will find all running instances
of Excel and if you un-comment the optional line it will find all running
programs on the machine.

I'm not sure what your programing level is so please don't take this the
wrong way.
If you open 2 notepad.exe "sessions" they are considered seperate instances.
That is they run in the own seperate "memory space".
Excel fights most attempts at this. Probably because the designers figured
it uses a lot of memory and other resources.
Excel is a MDI or Mulitpul Document Interface where you can have more than
one workbook open in 1 Excel instance and they can share resources.

The only way I know of to get a seperate instance of Excel is to open Excel
from the Startrun button or using VBA's Shell command to do the same.
Shell "start " & path & filename

--
John
johnf 202 at hotmail dot com


"Mark Grimes" wrote in message
...
| Hi John,
|
| I think that we're at cross-purposes here.
|
| The code that is run does not create the other instances of Excel,
| therefore your example needs to remove the GetObject() calls.
|
| The code needs to find the Excel objects that were created by other
applications or
| by someone opening up an instances of Excel.
|
| Any ideas much appreciated.
|
| Cheers,
| Mark.




 
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
How many entries can Excel handle!? Rebecca Sage Excel Discussion (Misc queries) 7 March 26th 10 07:22 AM
what is "fill handle". i don't see any fill handle in my excel Neelakanta New Users to Excel 32 June 18th 08 12:48 PM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 03:40 PM
Am I trying to do something that Excel cannot handle? KG Excel Discussion (Misc queries) 1 February 20th 05 01:40 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM


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

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

About Us

"It's about Microsoft Excel"