Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Does ActiveX control on spreadsheet exist?

I am using Excel 2003 on Windows XP.

If someone has a concise function to determine if an ActiveX control on a
spreadsheet exists, could you please post example code? For example,
ComboBox1?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Does ActiveX control on spreadsheet exist?

Please disregard this post. I located a function to do it.
Thanks to all who considered this issue and please excuse any inconvenience.

"quartz" wrote:

I am using Excel 2003 on Windows XP.

If someone has a concise function to determine if an ActiveX control on a
spreadsheet exists, could you please post example code? For example,
ComboBox1?

Thanks much in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Does ActiveX control on spreadsheet exist?

ActiveX controls are in the OLEObjects collection.

Dim obj as OleObject
Dim cbx as MSForms.combobox

bExits = False
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSForms.Combobox then
set cBx = obj.Object
if lcase(cbx.name) = "combobox1" then
bExists = True
exit for
end if
end if
Next


--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
I am using Excel 2003 on Windows XP.

If someone has a concise function to determine if an ActiveX control on a
spreadsheet exists, could you please post example code? For example,
ComboBox1?

Thanks much in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Does ActiveX control on spreadsheet exist?

Thanks Tom. I prefer your method to the other one I had found.

"Tom Ogilvy" wrote:

ActiveX controls are in the OLEObjects collection.

Dim obj as OleObject
Dim cbx as MSForms.combobox

bExits = False
for each obj in Activesheet.OleObjects
if typeof obj.Object is MSForms.Combobox then
set cBx = obj.Object
if lcase(cbx.name) = "combobox1" then
bExists = True
exit for
end if
end if
Next


--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
I am using Excel 2003 on Windows XP.

If someone has a concise function to determine if an ActiveX control on a
spreadsheet exists, could you please post example code? For example,
ComboBox1?

Thanks much in advance.




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
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
How to lock an ActiveX Control box on the spreadsheet? Ange Excel Worksheet Functions 1 October 29th 08 12:31 AM
Control array - does it exist in VBA as in VB? Örjan Leringe Excel Programming 2 August 9th 04 06:30 PM
ActiveX control jacob Excel Programming 1 November 22nd 03 06:03 PM
Using the Microsoft Spreadsheet Control as ActiveX Lawrence[_6_] Excel Programming 3 November 12th 03 03:56 PM


All times are GMT +1. The time now is 12:23 AM.

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"