Sign in to follow this  
Followers 0
gtheys

Loading Excell Addin

2 posts in this topic

I tried:

$sAddIn = "H:\prog\essxleqd.xla"
$oExcel = ObjCreate("Excel.Application")
$oExcel.Visible = 1
$oExcel.WorkBooks.Add
$oAddIn = $oExcel.AddIns.Add($sAddIn)
$oAddIn.Installed = True
$oExcel.WorkBooks.Open("H:\Balance_Inquiry.xls")

When I do:

<code>

Run('"c:\pathtoexcel\excel.exe" "c:\pathtoaddin\addin.xla"')

</code>

It will work. But I prefer the former solution because I need to different things in excel and this will be easier.

Share this post


Link to post
Share on other sites



UPDATE:

$sAddIn = "H:\prog\essxleqd.xla"
    $oExcel = ObjCreate("Excel.Application")
    $oExcel.Visible = 1
    $oExcel.WorkBooks.Add
    $oAddIn = $oExcel.AddIns.Add($sAddIn)
    $oAddIn.Installed = False
    $oAddIn.Installed = True
    $oExcel.WorkBooks.Open("H:\Balance_Inquiry.xls")

This seems to do the trick. Seems the first time when I ran the script it got installed and worked. Afterwards it didn't.

Weird part is that even when it is installed it doesn't execute second time. So each time I have to do the False part...

Maybe someone can explain or provide a more elegant solution.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0