ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rotate Fill Effect With Shape in VBA (https://www.excelbanter.com/excel-programming/431147-rotate-fill-effect-shape-vba.html)

EricG

Rotate Fill Effect With Shape in VBA
 
I have a little routine that replaces the data points on an X-Y chart series
with arrows pointing in the direction of the line. That part works fine.

The arrows are gradient filled block arrows, rotated to the proper angle for
each data point. The arrows start out horizontal, with a horizontal
one-color gradient fill.

When I rotate the arrows, the gradient fill is not rotating with them - it
stays horizontal. I recorded a macro to get the VBA code to set the gradient
fill. I am trying to figure out what property I need to set to emulate the
"Rotate fill effect with shape" check box option in the "Fill
Effects.../Gradient" dialog box. When I record macros with and without that
box checked, there is no difference in the code.

Do any of you know what the VBA code is to set that option?

TIA,

Eric


Peter T

Rotate Fill Effect With Shape in VBA
 
In theory this should do it

shp.Fill.RotateWithObject = msoTrue ' msoFalse

http://msdn.microsoft.com/en-us/library/bb242619.aspx

However the code fails for me trying to write. Read the value always returns
msoFalse 0 irrespective of the actual setting. Looks like a bug.

Regards,
Peter T

"EricG" wrote in message
...
I have a little routine that replaces the data points on an X-Y chart
series
with arrows pointing in the direction of the line. That part works fine.

The arrows are gradient filled block arrows, rotated to the proper angle
for
each data point. The arrows start out horizontal, with a horizontal
one-color gradient fill.

When I rotate the arrows, the gradient fill is not rotating with them - it
stays horizontal. I recorded a macro to get the VBA code to set the
gradient
fill. I am trying to figure out what property I need to set to emulate
the
"Rotate fill effect with shape" check box option in the "Fill
Effects.../Gradient" dialog box. When I record macros with and without
that
box checked, there is no difference in the code.

Do any of you know what the VBA code is to set that option?

TIA,

Eric




EricG

Rotate Fill Effect With Shape in VBA
 
Thanks for the input.

When I'm in the debugger, my block arrow shape does not have a
"RotateWithObject" property underneath the "Fill" property, so there is not
way to set it. I'm not sure if this is because it's an autoshape or what,
but if the property is not there, then there is no way to set it. Perhaps
it's just not exposed in the VBA object model?

I'll keep looking, but you are probably right about the bug.

Thanks,

Eric

"Peter T" wrote:

In theory this should do it

shp.Fill.RotateWithObject = msoTrue ' msoFalse

http://msdn.microsoft.com/en-us/library/bb242619.aspx

However the code fails for me trying to write. Read the value always returns
msoFalse 0 irrespective of the actual setting. Looks like a bug.

Regards,
Peter T



EricG

Rotate Fill Effect With Shape in VBA
 
P.S. - the MSDN reference is for 2007. I'm still running 2003.
--
..-------------------:
If toast always lands butter-side down, and cats always land on their feet,
what happen if you strap toast on the back of a cat and drop it?
Steven Wright (1955 - )


"Peter T" wrote:

In theory this should do it

shp.Fill.RotateWithObject = msoTrue ' msoFalse

http://msdn.microsoft.com/en-us/library/bb242619.aspx

However the code fails for me trying to write. Read the value always returns
msoFalse 0 irrespective of the actual setting. Looks like a bug.

Regards,
Peter T

"EricG" wrote in message
...
I have a little routine that replaces the data points on an X-Y chart
series
with arrows pointing in the direction of the line. That part works fine.

The arrows are gradient filled block arrows, rotated to the proper angle
for
each data point. The arrows start out horizontal, with a horizontal
one-color gradient fill.

When I rotate the arrows, the gradient fill is not rotating with them - it
stays horizontal. I recorded a macro to get the VBA code to set the
gradient
fill. I am trying to figure out what property I need to set to emulate
the
"Rotate fill effect with shape" check box option in the "Fill
Effects.../Gradient" dialog box. When I record macros with and without
that
box checked, there is no difference in the code.

Do any of you know what the VBA code is to set that option?

TIA,

Eric





Peter T

Rotate Fill Effect With Shape in VBA
 
Ah, OK.

Well there doesn't appear to be the equivalent of a RotateWithObject
property exposed at all in 2003/VBA, so can't even say it's a bug!

Regards,
Peter T

"EricG" wrote in message
...
P.S. - the MSDN reference is for 2007. I'm still running 2003.
--
.-------------------:
If toast always lands butter-side down, and cats always land on their
feet,
what happen if you strap toast on the back of a cat and drop it?
Steven Wright (1955 - )


"Peter T" wrote:

In theory this should do it

shp.Fill.RotateWithObject = msoTrue ' msoFalse

http://msdn.microsoft.com/en-us/library/bb242619.aspx

However the code fails for me trying to write. Read the value always
returns
msoFalse 0 irrespective of the actual setting. Looks like a bug.

Regards,
Peter T

"EricG" wrote in message
...
I have a little routine that replaces the data points on an X-Y chart
series
with arrows pointing in the direction of the line. That part works
fine.

The arrows are gradient filled block arrows, rotated to the proper
angle
for
each data point. The arrows start out horizontal, with a horizontal
one-color gradient fill.

When I rotate the arrows, the gradient fill is not rotating with them -
it
stays horizontal. I recorded a macro to get the VBA code to set the
gradient
fill. I am trying to figure out what property I need to set to emulate
the
"Rotate fill effect with shape" check box option in the "Fill
Effects.../Gradient" dialog box. When I record macros with and without
that
box checked, there is no difference in the code.

Do any of you know what the VBA code is to set that option?

TIA,

Eric








All times are GMT +1. The time now is 10:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com