Jump to content

Setting Combobox Values in Excel


sirkerry
 Share

Recommended Posts

No luck on the MSDN site. I have discovered it's actually a DropDown object that I need to set (it's either Excel.DropDowns or Excel.DropDown) so I've been messing around with AutoIT's COM support and have gotten the basics down (the same kinda stuff you can do with the Excel UDF), I'm not have any sucess accessing the DropDown objects embedded in my Excel worksheet. So any help I can get on this would be great.

Link to comment
Share on other sites

No luck on the MSDN site. I have discovered it's actually a DropDown object that I need to set (it's either Excel.DropDowns or Excel.DropDown) so I've been messing around with AutoIT's COM support and have gotten the basics down (the same kinda stuff you can do with the Excel UDF), I'm not have any sucess accessing the DropDown objects embedded in my Excel worksheet. So any help I can get on this would be great.

Finally figured it out after reading several web pages about COM objects and lots of trial and error:

$oExcel = ObjCreate("Excel.Application")               
WITH $oExcel
    .Visible = 1                                      
    .WorkBooks.Open($sFilePath)   
    .ActiveWorkBook.ActiveSheet.DropDowns("Drop Down 107").Value = 2  ;this gives you access to the DropDowns
    sleep(4000)                                         
    .ActiveWorkBook.Saved = 1                          
    .Quit                                              
ENDWITH
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...