PC Review


Reply
Thread Tools Rate Thread

Determine number of open excel files

 
 
gw.boswell@gmail.com
Guest
Posts: n/a
 
      24th May 2006
I have a macro in which I need to open a specific Excel file.
Unfortunately with the code below although I can open the file, whether
it is visible and can be accessed depends on how many other Excel files
are open. How can I determine how many excel files are already open

Set xlAppEval = GetObject(, "Excel.Application")

Set Model = GetObject("c:\EVAL.xls")

xlAppEval.Application.Visible = True
xlAppEval.Parent.Windows(3).Visible = True <== only works if 2 excel
files are already open.


Alternatively, is there a better way to open the specified as an OLE
object?

TIA,
Garry

 
Reply With Quote
 
 
 
 
dbahooker@hotmail.com
Guest
Posts: n/a
 
      24th May 2006
if you have one open then you've got too many

excel is a disease run away while you still can

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      25th May 2006
Garry,
Dim lngX as Long
lngX = xlAppEval.Workbooks.Count
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


<(E-Mail Removed)>
wrote in message
I have a macro in which I need to open a specific Excel file.
Unfortunately with the code below although I can open the file, whether
it is visible and can be accessed depends on how many other Excel files
are open. How can I determine how many excel files are already open

Set xlAppEval = GetObject(, "Excel.Application")
Set Model = GetObject("c:\EVAL.xls")

xlAppEval.Application.Visible = True
xlAppEval.Parent.Windows(3).Visible = True <== only works if 2 excel
files are already open.
Alternatively, is there a better way to open the specified as an OLE
object?

TIA,
Garry

 
Reply With Quote
 
gw.boswell@gmail.com
Guest
Posts: n/a
 
      25th May 2006
Jim,
You auggestion worked perfectly (which I'm sure you knew it would).
Thanks you very much. That makes my life a lot easier.
Garry

 
Reply With Quote
 
gw.boswell@gmail.com
Guest
Posts: n/a
 
      25th May 2006
Jim,
You suggestion worked perfectly (which I'm sure you knew it would).
Thanks you very much. That makes my life a lot easier.
Garry

 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      25th May 2006
Garry,
You are welcome.
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html


<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
Jim,
You suggestion worked perfectly (which I'm sure you knew it would).
Thanks you very much. That makes my life a lot easier.
Garry

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Sharepoint site & Determine the number of files and their nam Chilidog Microsoft Excel Programming 1 12th Jun 2009 01:18 AM
Determine number format of excel cell James Bond Microsoft Excel Programming 1 10th Oct 2006 06:02 AM
How to determine the number in excel? =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 1 13th Mar 2006 06:32 AM
Excel 2003 - Determine the number of printed pages =?Utf-8?B?U01PUkdT?= Microsoft Excel Programming 0 5th Dec 2005 10:56 PM
Determine open files on server from XP pro???? Matt Slay Microsoft Windows 2000 File System 1 15th Nov 2003 04:19 PM


Features
 

Advertising
 

Newsgroups
 


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