Setting Forms controls from outside

H

Hans Preuer

Hi,

I will telecommand an excel application from another excel application. All
works fine, except 2 combobox form controls, which I can't set from outside.
How can I set a combobox form control in an App1 by code from my 2nd App?

Set app1 = CreateObject("Excel.Application")
Set wb1 = appSchein.Workbooks.Open("Test.xls")

Set ws1 = wbSchein.Worksheets("Employees")
app1.Visible = True

ws1.Activate
ws1.Shapes("combobox1").select
?????????????????? does not work
SendKeys ("February")
??????????????????

Thanks
Hans
 
T

Tom Ogilvy

You mean a the forms toolbar and not the control toolbox toolbar

Dim drpdown as Excel.DropDown

.. . .


set drpdown = ws1.Dropdowns("combobox1")
drpdown.ListIndex = 2
 
H

Hans Preuer

Hi Tom,

Thank you for your Answer. The combobox is from the control toolbox toolbar
and not from the forms toolbar. Your code always results in an error
("Application or object specific error"). Is it possible to do it with a
toolbar from the controlbox?

Thanks for your help!!!
Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top