Jump to content

Loading Excell Addin


gtheys
 Share

Recommended Posts

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.

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...