Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default How to Do this Test in VBA?

How do I make VBA ask if a certain Excel file is already loaded (meaning
already in RAM)?

Thanks,

Dave

Please delete "ANTI-SPAM" from email address:
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default How to Do this Test in VBA?

If a workbook is open then it is part of the Workbooks.Collection read thru
the collection and if you find it you have the answer e.g......

Dim wB As Workbook
For Each wB In Workbooks
If wB.Name = "Book1" Then
MsgBox "My Workbook " & wB.Name & " is Open"
Else
MsgBox "Not Found!"
End If
Next


--
Cheers
Nigel



"David Godinger" wrote in message
...
How do I make VBA ask if a certain Excel file is already loaded (meaning
already in RAM)?

Thanks,

Dave

Please delete "ANTI-SPAM" from email address:




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to Do this Test in VBA?

Dim oWB As Workbook

On Error Resume Next
Set oWB = Workbooks("myBook.xls")
On Error Goto 0
If Not oWB Is Nothing Then
Msgbox oWB.Name & " is loaded"
End If

--

HTH

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


"David Godinger" wrote in message
...
How do I make VBA ask if a certain Excel file is already loaded (meaning
already in RAM)?

Thanks,

Dave

Please delete "ANTI-SPAM" from email address:




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
test carl Excel Worksheet Functions 0 June 29th 11 05:28 PM
Can you help test our Excel test? Jeff[_14_] Excel Discussion (Misc queries) 1 December 7th 09 05:11 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM
test..where are my messages..test HT New Users to Excel 0 January 23rd 05 06:23 PM
test exceltip Excel Programming 0 October 24th 03 08:55 PM


All times are GMT +1. The time now is 03:09 AM.

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"