#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Finding xla

I'm running Office 2007 and would like to how to test if a particular Excel
addin (.xla) is already open within the current application.
I have tried finding it as a workbook (see below) but .xla files are not
included in the workbooks collection.

Dim WB as Workbook, WA as Workbook
For Each WB in Application.Workbooks
If WB.Name = "MyAddin.xla" then
Set WA = WB
Exit For
End if
Next WB
If Not WA is Nothing then ...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Finding xla

Dim wb As Workbook

Set wb = Nothing
On Error Resume Next
Set wb = Workbooks("personal.xla")
On Error GoTo 0

If wb Is Nothing Then
MsgBox "not open"
Else
MsgBox wb.FullName
End If

Fred wrote:

I'm running Office 2007 and would like to how to test if a particular Excel
addin (.xla) is already open within the current application.
I have tried finding it as a workbook (see below) but .xla files are not
included in the workbooks collection.

Dim WB as Workbook, WA as Workbook
For Each WB in Application.Workbooks
If WB.Name = "MyAddin.xla" then
Set WA = WB
Exit For
End if
Next WB
If Not WA is Nothing then ...


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Finding xla

I like Dave's suggestion because it works consistently for addins and
workbooks, but if you want to enumerate opened addins, here is another way:

Dim ai As AddIn
Dim wb as Workbook
For Each ai In Application.AddIns
If ai.Installed = True And ai.Name = "MyAddin.xla" Then
Set wb = Workbooks(ai.Name)
Exit For
End If
Next

--
Tim Zych
SF, CA

"Fred" <leavemealone@home wrote in message
...
I'm running Office 2007 and would like to how to test if a particular
Excel addin (.xla) is already open within the current application.
I have tried finding it as a workbook (see below) but .xla files are not
included in the workbooks collection.

Dim WB as Workbook, WA as Workbook
For Each WB in Application.Workbooks
If WB.Name = "MyAddin.xla" then
Set WA = WB
Exit For
End if
Next WB
If Not WA is Nothing then ...




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
Finding the top 10 Bertha needs help[_2_] Excel Discussion (Misc queries) 13 August 5th 08 04:41 PM
Finding non-zero value Tom Stout Excel Discussion (Misc queries) 2 November 21st 07 05:20 PM
Finding Same Row Value JN[_6_] Excel Programming 4 May 26th 06 04:43 PM
finding value ceemo Excel Discussion (Misc queries) 4 April 20th 06 02:16 PM
finding a value tom[_6_] Excel Programming 1 August 11th 04 01:17 AM


All times are GMT +1. The time now is 10:57 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"