LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro Compatibility

Hello Everyone,
I have upgraded to Office 2007 from 2003 and now my users are complaining
about a macro that they use is not running. The code error's out on the
following line "ActiveSheet.ChartObjects(Varname).Activate"
This macro and many like it worked perfectly for 2003, is there something
That I need to load or is there new terms for 2007? I have paisted the rest
of the code below. Please advise.
-Dave

Sub HbarMacro()
'
' HbarMacro Macro
' Macro recorded 1/31/97 by ARC
' Color bars added 4/28/04 by DHill
'
' ActiveSheet.ChartObjects("Chart 1").Activate
' ActiveChart.ChartType = xl3DBarClustered
'
' Chart Macro
'
Varname1 = Selection.Address
Var = ActiveWorkbook.Name
Vars = ActiveSheet.Name
Charts.Add
ActiveChart.ChartType = xlBarClustered
'
' ActiveChart.ChartType = xl3DBarClustered
'
ActiveChart.SetSourceData Source:=Sheets(Vars).Range(Varname1), PlotBy _
:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:=Vars
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowValue, LegendKey:=False
Windows(Var).Activate
ActiveSheet.ChartObjects.Select
Varname = Selection.Name
ActiveSheet.ChartObjects(Varname).Activate
ActiveChart.ChartArea.Select
ActiveSheet.Shapes(Varname).Width = 444
ActiveSheet.Shapes(Varname).Height = 336
With Selection.Border
.Weight = 2
.LineStyle = 0
End With
'
' Change color of interior
'
' Selection.Interior.ColorIndex = 16
Sheets(Vars).DrawingObjects(Varname).RoundedCorner s = False
Sheets(Vars).DrawingObjects(Varname).Shadow = False
ActiveChart.Axes(xlCategory).Select
With Selection.Border
.ColorIndex = 57
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MajorTickMark = xlCross
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
Selection.TickLabels.AutoScaleFont = True
'
' Font selection
'
With Selection.TickLabels.Font
.Name = "Verdana"
.FontStyle = "Book"
.Size = 10.5
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlValue).Select
With Selection.Border
.ColorIndex = 57
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MajorTickMark = xlCross
.MinorTickMark = xlNone
.TickLabelPosition = xlNextToAxis
End With
Selection.TickLabels.AutoScaleFont = True
'
' Font selection
'
With Selection.TickLabels.Font
.Name = "Verdana"
.FontStyle = "Book"
.Size = 10.5
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.AutoScaleFont = True
'
' Font selection
'
With Selection.Font
.Name = "Verdana"
.FontStyle = "Book"
.Size = 10.5
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
'
' Bar color selection
'
With Selection.Interior
.ColorIndex = 5
.Pattern = xlSolid
End With
With ActiveChart.ChartGroups(1)
.Overlap = 0
.GapWidth = 50
.HasSeriesLines = False
.VaryByCategories = False
End With
ActiveChart.PlotArea.Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
'
' Change Bar Color 4/28/2004 by dhill
'

'
' ActiveChart.SeriesCollection(1).Select
' With Selection.Border
' .Weight = xlThin
' .LineStyle = xlAutomatic
' End With
' Selection.Shadow = False
' Selection.InvertIfNegative = False
' With Selection.Interior
' .ColorIndex = 5
' .Pattern = xlSolid
' End With
End Sub


 
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
Testing Reverse Compatibility and Compatibility in General dim Excel Discussion (Misc queries) 4 January 8th 08 01:02 PM
Macro compatibility with Excel 97 Chris L Excel Programming 6 September 26th 06 12:51 AM
URGENT Mac/PC macro compatibility problem marika1981 Excel Discussion (Misc queries) 7 January 8th 05 12:43 AM
Macro compatibility between excel XP and 97 darryl26 Excel Programming 0 July 30th 04 06:55 PM
Macro Compatibility M.Vance Excel Programming 1 August 29th 03 07:14 PM


All times are GMT +1. The time now is 01:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"