Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2007 won't execute 2003 VBA code
I have a macro that was created with Excel 2003 VBA code but sometimes Excel
2007 won't execute the code and sometimes it will. Any ideas what might be happening? Is Excel 2007 supposed to be backwards compatible? I can't use the new Excel 2007 code because not all my users have Excel 2007 yet. Most are still using Excel 2003. Excel 2003 Code: With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = strTitle + Chr(10) + strSubTitle .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = strXAxis .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = strYAxis End With However, this code does the same thing in Excel 2007 and it always works: Excel 2007 code: With ActiveChart .SetElement (msoElementChartTitleAboveChart) .ChartTitle.Text = strTitle + Chr(10) + strSubTitle .SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis) .Axes(xlCategory, xlPrimary).AxisTitle.Text = strXAxis .SetElement (msoElementPrimaryValueAxisTitleRotated) .Axes(xlValue, xlPrimary).AxisTitle.Text = strYAxis End With Thanks in advance, Lee |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 erases VBA code from Excel 2003 | Excel Programming | |||
Should this code work in Excel 2007 as it does in 2003? | Excel Programming | |||
2003--2007 recognize if i'm in 2007 or 2003 via code. | Excel Programming | |||
Automation C++ code works for Excel 2003, not for Excel 2007 | Excel Programming | |||
Help Excel 2003 code failing in 2007 | Excel Programming |