Forum Discussion

mohanakshi's avatar
mohanakshi
Contributor
13 years ago

Install addins to Excel

Hi,

       Upon opening Excel workbook "Microsoft Installer Window" should get open for installing Excel Com-addin. This is working fine manually. But when i ran the code below i could not see any installer window!. I want to know why it is so.. and what i can do for solving this issue as i have to install that addin for further testing operations.. Please help me.







Code is:

sub test()



  set Excelobj=Sys.oleobject("excel.application")    

  objexcel.workbooks.open("C:\Documents and Settings\smohanakshi\My Documents\New Folder\New Microsoft Office Excel Worksheet.xlsx")



End Sub





(I am using Excel 2007 and windows xp sp3)

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I can't say for certain but I think it has to do with the difference between running the Excel as an application and instatiating the Excel.Application COM object and the differences in code path that happens with those.  The code you've posted opens excel as a COM object and so, in order to trigger the COM add-in install, there may be additional steps you'll need to execute.
  • Hi,



    BTW, Excel is launched without visible windows via COM by default. To make it visible, assign true to its Visible property.



    Also, in the first line, you save the Excel object to a variable named 'Excelobj'. In the second line, you use something unitialized named 'objexcel'. This just cannot work as it is.
  • Hi,

         Thank u so much Robert... U r idea is working fine here.. Rock









    Regards,

    Mohanakshi