Folder location for Addins

D

Desaivres Alain

Hi

I am deploying an xla applications on tens of computers spread all over the
world and am wondering how I can get automaticaly (vbs script) the default
location for Addins...

Most of the time such a path will work
WshShell.ExpandEnvironmentStrings ("%APPDATA%"&"\Microsoft\AddIns\")

BUT I also know that on French machines the final path is not
"\Microsoft\AddIns\" but
"&"\Microsoft\Macro Complementaire\"

So is there someone who would know
- how many different locations exist ?
- how to find a way to automatically recover the exact location of a given
machine
My intention being to do that through a vbs script...

Thanks to you
Kind Regrads
Alain
 
B

Bob Phillips

Why would you need to know the addin location? I have deployed many addins,
and I can't recall needing to know this.
 
J

john

forgot to add that you may find following code useful as well.

Sub FindAddins()
With Worksheets(1)
.Rows(1).Font.Bold = True
.Range("a1:d1").Value = _
Array("Name", "Full Name", "Title", "Installed")
For i = 1 To AddIns.Count
.Cells(i + 1, 1) = AddIns(i).Name
.Cells(i + 1, 2) = AddIns(i).FullName
.Cells(i + 1, 3) = AddIns(i).Title
.Cells(i + 1, 4) = AddIns(i).Installed
Next
.Range("a1").CurrentRegion.Columns.AutoFit
End With

End Sub
 
D

Desaivres Alain

Yes understood and can be the case I'll do it that way in a near futur...
For the moment "my" users (around 150) are used to do it themselves inside
the "per default" location and in order not to modify all at the same time,
my willing was while using now a vbs script for the installation to place the
xla application at the place they are used to find it... Which mean
....\Microsoft\Application Data\Addins\

The problem being that this location seems to be atached to the office
native country... Having for example ...\Microsoft\Macros Complementaires for
pure french Office...

I also have the feeling that this kind of location have desappeared with
office 2007 but not sure...

Thanks for your contribution
Regards
Alain
 
D

Desaivres Alain

Thanks for this input but then how to place such a command inside a script file
What to place i spite of application inside "Application.UserLibraryPath"
Sorry for this silly question but I am not yet so used with scripting...

More or less same question concerning the code you suggested in order to
list Addins... Is it possible to run such a code into a script while Excel is
switched off... ?

Thanks once more
Regards
Alain
 
D

Desaivres Alain

Hi...

Point1 => with my script supposed to run on logon I just want to be able to
update an xla file with a new version having the same name and this without
disturbing the user...

Point2 => why in this specific location ? my users are already used to
activate their addins manually through standard addins activation window,
then my intention is not to change that point, for teh moment...

The suggestion given per john and based on the command
Application.UserLibraryPath is rather interesting for me but I do not know
yet know how to use such a command inside a vbscript... erhaps it's even not
possible !

Regards
Alain

Regards
Alain
 
B

Bob Phillips

It would be

addinPath = Application.UserLibraryPath

but if the code is in the addin (why else would you have an addin), then why
would you not use

addinPath = ThisWorkbook.Path

or even if you are accessing an adding from another addin you could use

addinPath = Workbooks("other addin.xla").Path

or

addinName = Workbooks("other addin.xla").FullName
 
D

Desaivres Alain

Thanks for your help
I have finaly found my way...
Here it is

On Error Resume Next
Set appXL = CreateObject("Excel.Application")
If Err = 0 Then
addin_folder = appXL.UserLibraryPath
Else
addin_folder = _
WshShell.ExpandEnvironmentStrings ("%APPDATA%"&"\Microsoft\AddIns\")
End If
On Error Goto 0
Set appXL = Nothing

Regards
Alain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top