what is the status "Hidden" in MSDN (it means deprecated)

  • Thread starter srinivas Tirumala
  • Start date
S

srinivas Tirumala

http://msdn.microsoft.com/en-us/library/bb242669.aspx
consider this link, which gives the Object Model Changes Since Microsoft
Office 2003 of Excel object model

can u please give complete idea regarding the status "Hidden". Why I want to
know about it.

some of the properties which I am using are Hidden in 2007 object model. But
they still exhibiting the same functionality.

For example:
Chart Object.PlotArea.Fill returns ChartFillFormat object. But in 2007 both
the ChartFillFormat object and property Fill of PlotArea are hidden.

Actual requirement is like following.
..PlotArea.Fill.Visible = True
..PlotArea.Fill.OneColorGradient Style:=msoGradientHorizontal, Variant:=1,
Degree:=0.3

So kindly help me in this regard.

Thanks in advance.
 
P

Peter T

Not sure I can give you "complete" picture about "Hidden", just a few
comments -

The Excel 2007 object model has many new methods and properties. Where these
replace or enhance the old way of doing things the old keyword is "hidden".
Typically hidden methods will still work for compatibility, however you are
encouraged to use the new method.

There are a few things which are both hidden and fully deprecated, eg
FileSearch will error in Excel 2007 (though the code is still recognised by
the compiler)

To view hidden keywords, in Object browser F2 right click in one of the
panes and click "show hidden members"

Your Plotarea OneColorGradient code should work fine in 2007, however for
anything to do with formatting charts or shapes better to go through
"Format"

XL 97-2003
cht.PlotArea.Fill.OneColorGradient etc
XL2007
cht.PlotArea.Format.Fill.OneColorGradient etc

Although no difference in this example, with many other format properties
Excel 2007 offers significantly more options if you go through "Format".

It doesn't help that the macro recorder does not record many actions to
objects. Be sure to fully declare all object variables you are likely to use

Dim cht as Chart, pa as PlotArea

as you type the dot after pa look at the intellisense and follow your nose,
eg

pa dot format dot fill dot OneColorGradient

Be aware that code containing new methods will likely fail if run in earlier
Excel versions.

Regards,
Peter T
 
S

srinivas Tirumala

I tried "PlotArea.Format.Fill" as u mentioned, but no result. Even older
version code "PlotArea.Fill" is working properly.

Thanks for your nice explanation, Peter T.
 
P

Peter T

I tried "PlotArea.Format.Fill" as u mentioned, but no result.

Try this with a new chart in Excel 2007

Sub test()
Dim cht As Chart
Set cht = ActiveSheet.ChartObjects(1).Chart

cht.PlotArea.Format.Fill.OneColorGradient _
Style:=msoGradientHorizontal, Variant:=1, Degree:=0.3

End Sub

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top