Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default label control from macro

recently, i beleived that executing "recorded macro" must produce the very
*same* effect like the action was recorded

but i found the difference for label form control

inserting from control toolbox i created the label, and the recorded macro
was:
'------
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=416.25, Top:=114.75, Width:=157.5, Height _
:=78.75).Select
'------

running that macro [on other worksheet] produced different result, that
object missed the "properties" item from right-click menu
also, macro didn't record the property editing [caption] that i did during
label insertion

is it expecting behaviour, or am i doing something wrong?

i expected that recorded macro *allways* produce the same effect like the
user interactive action?

is there some workaround to got exactly the same result with macro and
interactive action?

thnx


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default label control from macro

Not sure what you mean. A Control Toolbox label doesn't have a properties
option on right-click, at least not in the XP I am running.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"sali" wrote in message
...
recently, i beleived that executing "recorded macro" must produce the very
*same* effect like the action was recorded

but i found the difference for label form control

inserting from control toolbox i created the label, and the recorded macro
was:
'------
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=416.25, Top:=114.75, Width:=157.5, Height _
:=78.75).Select
'------

running that macro [on other worksheet] produced different result, that
object missed the "properties" item from right-click menu
also, macro didn't record the property editing [caption] that i did during
label insertion

is it expecting behaviour, or am i doing something wrong?

i expected that recorded macro *allways* produce the same effect like the
user interactive action?

is there some workaround to got exactly the same result with macro and
interactive action?

thnx




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default label control from macro

It's not clear what you mean by properties in the 'right-click' menu. But
guessing, recorded macros to not record changes to properties of OLEObjects
such as Label caption.

Try this-

Sub test()
Dim ole As OLEObject

Set ole = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", _
Link:=False, DisplayAsIcon:=False, _
Left:=416.25, Top:=114.75, Width:=157.5, Height:=78.75)

ole.Object.Caption = "My Label Caption"

End Sub

also have a look at the following after you have added at least one Label
to the sheet

Sub test2()

Set ole = ActiveSheet.OLEObjects(1)

Stop
'press Alt-v, s
' look at ole in Locals
' and in particular expand the + next to Object for more properties

' press F8 or F5 to complete the routine
End Sub

Regards,
Peter T


"sali" wrote in message
...
recently, i beleived that executing "recorded macro" must produce the very
*same* effect like the action was recorded

but i found the difference for label form control

inserting from control toolbox i created the label, and the recorded macro
was:
'------
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label .1", Link:=False, _
DisplayAsIcon:=False, Left:=416.25, Top:=114.75, Width:=157.5, Height _
:=78.75).Select
'------

running that macro [on other worksheet] produced different result, that
object missed the "properties" item from right-click menu
also, macro didn't record the property editing [caption] that i did during
label insertion

is it expecting behaviour, or am i doing something wrong?

i expected that recorded macro *allways* produce the same effect like the
user interactive action?

is there some workaround to got exactly the same result with macro and
interactive action?

thnx




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default label control from macro

for info, i tested few, office2000 and office2002, both the same
control toolbox has big capital letter "A" for label insertion
right-click ona inserted label gives me:
==============
cut
copy
paste
-----
properties
view code
-----
label object
-----
grouping
order
-----
format control ...
===============

the label inserted with recorded macro is missing properties and view code
items

not to being a big problem, more to be surprised that recorded macro action
behaving different result


"Bob Phillips" je napisao u poruci interesnoj
...
Not sure what you mean. A Control Toolbox label doesn't have a properties
option on right-click, at least not in the XP I am running.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default label control from macro

You are absolutely right. I could have sworn I didn't see it with a manually
added label before, but it is there now.

How odd.

You can get at the properties though by double-clicking the label, and that
will take you into the VBIDE for that control, and the properties panes is
shown there.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"sali" wrote in message
...
for info, i tested few, office2000 and office2002, both the same
control toolbox has big capital letter "A" for label insertion
right-click ona inserted label gives me:
==============
cut
copy
paste
-----
properties
view code
-----
label object
-----
grouping
order
-----
format control ...
===============

the label inserted with recorded macro is missing properties and view code
items

not to being a big problem, more to be surprised that recorded macro
action behaving different result


"Bob Phillips" je napisao u poruci interesnoj
...
Not sure what you mean. A Control Toolbox label doesn't have a properties
option on right-click, at least not in the XP I am running.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default label control from macro

thnx for your example of object prop changing.
i suppose, object editing is hidden from macro recorder?

right-click:
when right-click onto inserted label in worksheet, the pop up menu is not
the same when label inserted interactively, or by recorded macro [of the
same action].
as i explained in my post, there is two items missing when inserting by
macro.
but just maybe my office instalation is "tweaked" maybe by some corporate
common controls
currently, all computers i have access to are part of corporate network


"Peter T" <peter_t@discussions je napisao u poruci interesnoj
...
It's not clear what you mean by properties in the 'right-click' menu. But
guessing, recorded macros to not record changes to properties of
OLEObjects
such as Label caption.

Try this-

Sub test()
Dim ole As OLEObject



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default label control from macro

First, I hope this typo in my previous post was not misleading

recorded macros to not record changes etc...

should read
recorded macros Do not record changes etc...

i suppose, object editing is hidden from macro recorder?


Indeed some property changes of oleObjects are not recorded. However an
OLEObject is also a Shape and some properties that can be changed via the
right-click "Format Object" dialog will be recorded.

I'd suggest don't worry about what you can and cannot record. Use the
example I posted earlier. It's important to know if the property you want to
change applies to
OLEObject or to OLEObject.Object.

I don't follow what you are trying to say regarding the right-click menu,
for me there is no difference in the menus if the control is inserted
manually or programmatically. Note that manually you should go into 'Design
mode' (top left icon on control toolbox menu) before right clicking the
object and "Format Object" and/or selecting "Properties".

Regards,
Peter T


Regards,
Peter T

"sali" wrote in message
...
thnx for your example of object prop changing.
i suppose, object editing is hidden from macro recorder?

right-click:
when right-click onto inserted label in worksheet, the pop up menu is not
the same when label inserted interactively, or by recorded macro [of the
same action].
as i explained in my post, there is two items missing when inserting by
macro.
but just maybe my office instalation is "tweaked" maybe by some corporate
common controls
currently, all computers i have access to are part of corporate network


"Peter T" <peter_t@discussions je napisao u poruci interesnoj
...
It's not clear what you mean by properties in the 'right-click' menu.

But
guessing, recorded macros to not record changes to properties of
OLEObjects
such as Label caption.

Try this-

Sub test()
Dim ole As OLEObject





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default label control from macro

thnx

knowing the object strucure, it is easy to change its properties by macro

regarding right-click pop up menu, i don't want to insist [anyway it is
auxilary problem] but somebody on this tread also agreed that right-click
pop up menu is realy not the same when you insert label manualy, or with
recorded macro.

but, please, this is just my observation, thnx for you helping me understand
the problem and its backgound

thnx

"Peter T" <peter_t@discussions je napisao u poruci interesnoj
...
First, I hope this typo in my previous post was not misleading


. It's important to know if the property you want to
change applies to
OLEObject or to OLEObject.Object.

I don't follow what you are trying to say regarding the right-click menu,
for me there is no difference in the menus if the control is inserted
manually or programmatically. Note that manually you should go into
'Design
mode' (top left icon on control toolbox menu) before right clicking the
object and "Format Object" and/or selecting "Properties".



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default label control from macro

i don't want to insist

Sorry, you are absolutely right !

It seems the right click popup menu named "OLE Object" becomes 'attached' to
Active x controls that were added programmatically. Whereas if added
manually, the popup menu named "ActiveX Control" is attached ('attached' is
not quite the right word).

The "OLE Object" popup does not include the "Properties" button (and some
other differences).

Anyway, you can still get to "Properties" if you click the "Properties" icon
on the Control toolbox toolbar.

I had never noticed, and I agree it's odd.

Regards,
Peter T



"sali" wrote in message
...
thnx

knowing the object strucure, it is easy to change its properties by macro

regarding right-click pop up menu, i don't want to insist [anyway it is
auxilary problem] but somebody on this tread also agreed that right-click
pop up menu is realy not the same when you insert label manualy, or with
recorded macro.

but, please, this is just my observation, thnx for you helping me

understand
the problem and its backgound

thnx

"Peter T" <peter_t@discussions je napisao u poruci interesnoj
...
First, I hope this typo in my previous post was not misleading


. It's important to know if the property you want to
change applies to
OLEObject or to OLEObject.Object.

I don't follow what you are trying to say regarding the right-click

menu,
for me there is no difference in the menus if the control is inserted
manually or programmatically. Note that manually you should go into
'Design
mode' (top left icon on control toolbox menu) before right clicking the
object and "Format Object" and/or selecting "Properties".





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default label control from macro

Pretty good. He gets two apologies from doubters in one thread <vbg

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Peter T" <peter_t@discussions wrote in message
...
i don't want to insist


Sorry, you are absolutely right !

It seems the right click popup menu named "OLE Object" becomes 'attached'
to
Active x controls that were added programmatically. Whereas if added
manually, the popup menu named "ActiveX Control" is attached ('attached'
is
not quite the right word).

The "OLE Object" popup does not include the "Properties" button (and some
other differences).

Anyway, you can still get to "Properties" if you click the "Properties"
icon
on the Control toolbox toolbar.

I had never noticed, and I agree it's odd.

Regards,
Peter T



"sali" wrote in message
...
thnx

knowing the object strucure, it is easy to change its properties by macro

regarding right-click pop up menu, i don't want to insist [anyway it is
auxilary problem] but somebody on this tread also agreed that right-click
pop up menu is realy not the same when you insert label manualy, or with
recorded macro.

but, please, this is just my observation, thnx for you helping me

understand
the problem and its backgound

thnx

"Peter T" <peter_t@discussions je napisao u poruci interesnoj
...
First, I hope this typo in my previous post was not misleading


. It's important to know if the property you want to
change applies to
OLEObject or to OLEObject.Object.

I don't follow what you are trying to say regarding the right-click

menu,
for me there is no difference in the menus if the control is inserted
manually or programmatically. Note that manually you should go into
'Design
mode' (top left icon on control toolbox menu) before right clicking the
object and "Format Object" and/or selecting "Properties".









  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default label control from macro

Pretty good. He gets two apologies from doubters in one thread <vbg

and rightly so :-)

Certainly taught me to pay more attention in future, for the next hour or
two at least !

Peter T


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default label control from macro

Blimey, you've got a long attention span. I'm impressed <ebg

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Peter T" <peter_t@discussions wrote in message
...
Pretty good. He gets two apologies from doubters in one thread <vbg


and rightly so :-)

Certainly taught me to pay more attention in future, for the next hour or
two at least !

Peter T




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
2 Label Options - Forms Object vs Control Box Object Awrex Excel Discussion (Misc queries) 3 July 17th 09 07:10 PM
Is it possible to Link a Label control to a cell ? Ben Excel Worksheet Functions 0 July 9th 07 10:32 PM
Newbie: how to show the checked symbol in a label control Frank Excel Programming 1 September 18th 06 10:01 AM
Format number as currency in label control ? Marc Gendron[_2_] Excel Programming 1 July 17th 06 09:58 PM
Label control - suppress GetFocus Peter Davey Excel Programming 5 July 27th 05 08:57 AM


All times are GMT +1. The time now is 04:20 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"