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. |
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. |
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. |
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. |
All times are GMT +1. The time now is 03:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com