Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Setting Forms controls from outside

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting Forms controls from outside

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

--
Regards,
Tom Ogilvy



"Hans Preuer" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Setting Forms controls from outside

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


"Tom Ogilvy" schrieb im Newsbeitrag
...
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

--
Regards,
Tom Ogilvy



"Hans Preuer" wrote in message
...
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





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Setting Forms controls from outside



ws1.Activate
ws1.OleObjects("combobox1").Object.Value = "February"

--
Regards,
Tom Ogilvy



"Hans Preuer" wrote in message
...
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


"Tom Ogilvy" schrieb im Newsbeitrag
...
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

--
Regards,
Tom Ogilvy



"Hans Preuer" wrote in message
...
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX to Forms controls Sian Excel Discussion (Misc queries) 2 January 31st 08 12:22 AM
Excel forms controls [email protected] Excel Discussion (Misc queries) 1 March 18th 07 04:37 AM
Forms controls Catalin Excel Worksheet Functions 2 May 11th 06 03:44 PM
Forms Controls Larry Dodd Excel Programming 4 March 27th 05 11:39 AM
Forms Controls Chuck Taylor Excel Programming 2 December 1st 03 01:42 PM


All times are GMT +1. The time now is 07:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"