Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Object in Macro

Status
Not open for further replies.
Sep 16, 2005
191
US
Anyone know how or why when there is an checkbox on the worksheet it does not show the Object name in the Visual Basic Editor? Bascially, there is several checkboxs on the worksheet but when I look at the VB Editor, there is no object listed? Why?
 
If it is a FORMS checkbox, it does not.

If it is an ActiveX checkbox, it does.

Gerry
 
Activex controls on worksheet are displayed in VBE only in design mode (properties window).

combo
 
there is no object listed?
Assumption: listed somewhere....on a list. Not exactly "displayed". Also, I admit I was only posting regarding Word.

In Word, ActiveX control objects are "listed" within IntelliSense and can be selected in a VBE a code module. This happens whether the Properties window is open, or not. Whether in design mode, or not.

I guess in Excel you have to be in design mode.

Gerry
 
Well, you don't have to be in design mode if you are in the VBE. You do need to click the Object drop down (has the text "(General)" in the drop down) just at the top and left of the code window. There is where you'll see the list of objects (including ActiveX controls) in the Excel VBEIDE. The Procedure drop down directly right of the Object drop down will allow you to select the action/event of the specific control specified.

HTH

-----------
Regards,
Zack Barresse
 
In the ThisDocument module (but NOT standard modules) you can simply start typing the name of the object. It appears in IntelliSense.

eg. "tex" and Ctrl-SpaceBar will jump IntelliSense right to Textbox1 - assuming there is a ActiveX textbox1. You do need to click the Object dropdown to get the Procedures available. However, all valid methods applicable to the object are available through IntelliSense.

eg. "tex", Ctrl-Spacebar, ".v="Hello"", and Enter will write:

Textbox1.Value = "Hello"

"msg", Ctrl-Spacebar, space, "tex", Ctrl-Spacebar, ".te" and Enter, will write:

Msgbox Textbox1.Text

Gerry
 
In Excel it is the ThisWorkbook module. Also, it would be the worksheet the control is on where the object is located; go to that sheet, type "Me.tex" then spacebar to get the effect you're after.

NB: No real need for spacebar if you keep typing the next needed character, e.g. ".", "(", etc.

-----------
Regards,
Zack Barresse
 
In Word, you don't need to type the "Me" in "me.tex", just "tex" will do.
NB: No real need for spacebar if you keep typing the next needed character, e.g. ".", "(", etc.
I don't quite get this.

"tex" requires the ctrl-spacebar to get the object. "tex" and then "." will NOT get "textbox1." At least not in Word.

Gerry
 
In Excel it does though. That is one difference I did not know about. Thanks for the info Gerry.

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top