Sign in to follow this  
Followers 0
sirkerry

Setting Combobox Values in Excel

4 posts in this topic

Is there any way to set the value of a combobox control embedded in an Excel worksheet from AutoIt?

Share this post


Link to post
Share on other sites



Yes , i saw something like that on the MSDN excel/VBA object model.

How exactly - check out the MSDN. Later i will check it out myself if you havent succeeded.

Share this post


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

Share this post


Link to post
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

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