Link to home
Create AccountLog in
Avatar of JAWC
JAWCFlag for United Kingdom of Great Britain and Northern Ireland

asked on

excel add-ins

Hi I have created a vbscript
Dim oXL , oAddin
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add("K:\asset\Asset1.xla", True)
Set oAddin = oXL.AddIns.Add("K:\asset\Asset2.xla", True)
Set oAddin = oXL.AddIns.Add("K:\asset\Asset3.xla", True)
Set oAddin = oXL.AddIns.Add("K:\asset\Asset4.xla", True)
oAddin.Installed = True
oXL.Quit
Set oXL = Nothing

only the first and the last add-ins were added but none of them are ticked in the add-ins windows in excel 2010

Your help is much appreciated in a VBscript or a batch file to run with Activesetup.

Many thanks
SOLUTION
Avatar of Steve
Steve
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of JAWC

ASKER

You mean this way?

Dim oXL , oAddin
Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Add
Set oAddin = oXL.AddIns.Add("K:\asset\Asset1.xla", True)
Application.AddIns("asset1 tech").Installed = True
Set oAddin = oXL.AddIns.Add("K:\asset\Asset2.xla", True)
Application.AddIns("asset2 tech").Installed = True
Set oAddin = oXL.AddIns.Add("K:\asset\Asset3.xla", True)
Application.AddIns("asset3 tech").Installed = True
Set oAddin = oXL.AddIns.Add("K:\asset\Asset4.xla", True)
Application.AddIns("asset3 tech").Installed = True
oAddin.Installed = True
oXL.Quit
Set oXL = Nothing
Avatar of JAWC

ASKER

*Application.AddIns("asset4 tech").Installed = True
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of JAWC

ASKER

I've requested that this question be closed as follows:

Accepted answer: 0 points for JAWC's comment #a38575737

for the following reason:

it works for me.
Seems like The_Barman's tip about setting the Installed property to True set JAWC on the right path... surely he should get something for his efforts??
As per armchair_scouse's comment, I provided the solution:
(that the addin requires .installed = true)
Even if this is deemed as not an Excellent answer, it did seem to get JAWC going in the right direction.
Avatar of JAWC

ASKER

Moderator kindly decide many thanks.
Avatar of JAWC

ASKER

My script was complete. Your appreciated help gave an answer which already implemented in my initial script. What was missing is defining the statement oaddin1, 2 etc....
Your script was incomplete as it did not turn on the installed property for each one.
Once aware of the need to "install" each one (as suggested in my post) you were more than capable of arriving at the final solution.
The point is that you asked for assistance and received it.
The assistance was of some use as it clearly got you going in the right direction.
For this I would normally recieve  som recognition, even if this was just a "poor" answer.

Anyhoo, I am happy that you have gotten back on track, so will leave the descision making to the admin team.
Avatar of JAWC

ASKER

I have no objection. Many thanks for the effort the_barman